Add custom attribute to a developer via API call

Not applicable

I am using following command to create developer.

curl -v -X POST -H "Content-Type:application/xml" -d '<Developer><Email>tets_cus1@abc.com</Email><FirstName>Dewi</FirstName><LastName>Thomas</LastName><UserName>tets_cus1@abc.com</UserName><Attributes><Attribute><Name>MINT_SUPPORTED_CURRENCY</Name><Value>usd</Value></Attribute><Attribute><Name>MINT_REGISTRATION_ID</Name><Value></Value></Attribute><Attribute> <Name>MINT_DEVELOPER_LEGAL_NAME</Name><Value>tets_cus1@abc.com</Value></Attribute><Attribute><Name>MINT_DEVELOPER_TYPE</Name><Value>UNTRUSTED</Value> </Attribute><Attribute><Name>MINT_BILLING_TYPE</Name><Value>PREPAID</Value></Attribute><Attribute><Name>MINT_0_ADDRESS</Name><Value>{ "address1":"","address2":"","city":"","country":"GB","isPrimary":"true","state": "","zip":"" }</Value></Attribute></Attributes><QUOTA_OVERRIDE_LIMIT>1111</QUOTA_OVERRIDE_LIMIT><</Developer>' 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 .

Solved Solved
1 7 768
1 ACCEPTED SOLUTION

@kumarsathe - You'd add it as an attribute with a <Name> and <Value> just like the other attributes inside the <Attributes> block. For example:

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

Hope that helps!

View solution in original post

7 REPLIES 7

@kumarsathe - You'd add it as an attribute with a <Name> and <Value> just like the other attributes inside the <Attributes> 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 ..

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.