Add custom attribute to a developer via API call

I am using following command to create developer.

curl -v -X POST -H “Content-Type:application/xml” -d ‘tets_cus1@abc.comDewiThomastets_cus1@abc.comMINT_SUPPORTED_CURRENCYusdMINT_REGISTRATION_ID MINT_DEVELOPER_LEGAL_NAMEtets_cus1@abc.comMINT_DEVELOPER_TYPEUNTRUSTED MINT_BILLING_TYPEPREPAIDMINT_0_ADDRESS{ “address1”:“”,“address2”:“”,“city”:“”,“country”:“GB”,“isPrimary”:“true”,“state”: “”,“zip”:“” }<QUOTA_OVERRIDE_LIMIT>1111</QUOTA_OVERRIDE_LIMIT><’ https://api.enterprise.apigee.com/v1/organizations/wci-nonprod/developers -u kumarsathe@abc.com

I want to add ‘QUOTA_OVERRIDE_LIMIT - 1000’ this custom attribute to a developer. Please let me know how to do this via api call .

1 Like

@kumarsathe - You’d add it as an attribute with a and just like the other attributes inside the block. For example:

<Attributes>
...
<Attribute><Name>QUOTA_OVERRIDE_LIMIT</Name><Value>1000</Value></Attribute>
</Attributes>

Hope that helps!

That’s great for adding custom attributes at the point that the developer-app is created.

Is there any way to add a new custom-attribute to an existing developer-app via the management API ?

… It appears that the management API only supports updating and deleting existing custom attributes.

Never mind, answered my own question - the ‘Update All Attributes’ management-API call allows both updating of existing attributes and adding new ones.

Thanks for sharing @John Reece!

@docs team: possibly something to clarify/emphasize in docs?

I think your question is still unanswered, that function will not allow you to add a new attribute to existing app with already customs attributes in it. Because if you try adding one , it will replace/delete all other ..

1 Like

Adding to @Floyd Jones’s answer

You will have to copy the previous attributes also in your PUT operation call. I have observed the same behavior while updating API products in a developer app as well. I guess this is because the operation is doing a full update instead of a partial update, hence requires the full resource information. Which makes sense also since its a PUT operation and not a PATCH.

@docs team, may be this information can be mentioned explicitly in the documentation

@snehal chakraborty @Floyd Jones, yeah I agree with the PATCH operation is missing, and another discrepancy is if I try a POST on /{app}/attributes with a single attribute it replaces all the other custom attributes.

1 Like