Issue in associating product to developer app through proxy

nsaini
Participant IV

Hi

I am trying to create a developer app thru a proxy and asigning product to it. If i open trace and copy the exact body of service callout and run thru apigee management API UI, It works fine. If I am doing it through my proxy, developer app is created but there is no product attached to it. Can anyone help?

{ "name" : "Test1", "apiProducts": ["product-v1"], "keyExpiresIn" : "-1", "callbackUrl" : "https://test.com", "attributes" : [ { "name" : "DisplayName", "value" : "Test1" }, { "name" : "Notes", "value" : "Test" } ] }

My code:

POST

https://api.enterprise.apigee.com/v1/organizations/{organization.name}/developers/{email}/apps

{ "name" : "{client_name}", "apiProducts": {allowedProducts}, "keyExpiresIn" : "-1", "callbackUrl" : "{requestRedirectUris}", , "attributes" : [ { "name" : "Notes", "value" : "Test" }]}

value of allowedProducts in trace: ["product-v1"]

0 6 407
6 REPLIES 6

nsaini
Participant IV

sidd-harth
Participant V

The Create Developer App API should work fine in a proxy. But it is not recommended to use Management APIs in proxies. Please tell us your requirement, they may be some other alternatives.

Anyway in the proxy, if you are using Service Callout(SC) policy, did you add contentType in payload? I hope you have a Product with name product-v1.(anyway without it you will get 404 error)

Just to check, I have done it through a proxy, it creates App & associates a product to it. So if possible provide your SC policy config & the final payload you see in Trace, mask confidential data.

Hi Siddharth

The reqt is to onboard a new developer app thru a dynamic registration endpoint(proxy in this case) and yes I have set contentType in payload as well as added as header also

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ServiceCallout async="false" continueOnError="false" enabled="true" name="SC.Create.DevApp"> <DisplayName>SC.Create.DevApp</DisplayName> <Request clearPayload="true" variable="devAppRequest"> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <Set> <Headers> <Header name="Content-Type">application/json</Header> <Header name="Authorization">Basic {private.TECHNICAL_USER_CREDENTIALS}</Header> </Headers> <Verb>POST</Verb> <Payload contentType="application/json"> { "name" : "{client_name}", "apiProducts": {allowedProducts}, "keyExpiresIn" : "-1", "callbackUrl" : "{requestRedirectUris}", "attributes" : [ { "name" : "Notes", "value" : "Ob TPP" } ] } </Payload> </Set> </Request> <Response>devAppResponse</Response> <HTTPTargetConnection> <Properties/> <URL>https://api.enterprise.apigee.com/v1/organizations/{organization.name}/developers/{email}/apps</URL> </HTTPTargetConnection> </ServiceCallout>

For onboarding developer & creating app, why not use a developer portal?

--

In the payload did you try with a static value in "apiProducts": ["apiProduct"]?

Are you certain that

 "apiProducts": {allowedProducts},

...resolves into something that looks like

 "apiProducts": [ "product1", "product2", "product3" ],

??

To check, you could use an additional AssignMessage policy that mirrors what you are using in the ServiceCallout. Just assign using the same template into an arbitrary new request message.

You said "developer app is created but there is no product attached to it" . Can you show us the response payload?

Finally, Siddharth said it. But just in case you missed it, take good care when you use Management APIs in proxies.

sonalishyam
Participant II
@NSaini1

Did you implement dynamic registration endpoint using management API itself or is there any other approach possible?

Was this done for open banking