Update Developer App using Management API

Hi,
I want to update the configure a set of credentials with an expiry date.

I used the below cURL, only the credentials are configured, but the expiry of the credentials is set to "Never".

How can I achieve to configure both the credentials and it's expiry time?

 

curl -v -k -H 'Content-type:application/json' -u abc@example.com 'localhost:8080/v1/organizations/org/developers/developer/apps/test-App/keys/create' -X POST -d \
'{"consumerKey":"abc","consumerSecret": "xyz", "keyExpiresIn": 31536000000}'

 

 

Solved Solved
0 2 151
1 ACCEPTED SOLUTION

Hey Rohit

AFAIK in OPDK it's not possible for you to import a credential, and apply an expiry to that imported credential.  You can do one or the other. You can import a credential, and it's always "expires never", or you can specify an expiry, in which case you do not get to specify the consumerKey and consumerSecret.   

This is changed in X/hybrid, so that you can do both in one request. 

BUT, I am not certain of this. I am not certain the newer admin payload is not ALSO supported on the latest OPDK.  The request format I have for X/hybrid uses expiresInSeconds, not keyExpiresIn. like this: 

 

POST :apigee/v1/organizations/:org/developers/:dev/apps/:app/keys/create
Authorization: Bearer :token
content-type: application/json

{
  "apiProducts": ["Product1", "Product1"],
  "consumerKey": "REQUIRED",
  "consumerSecret": "REQUIRED",
  "expiresInSeconds": "864000"
}

 

Can you try that?  I do not have an OPDK to try it on. 

View solution in original post

2 REPLIES 2

Hey Rohit

AFAIK in OPDK it's not possible for you to import a credential, and apply an expiry to that imported credential.  You can do one or the other. You can import a credential, and it's always "expires never", or you can specify an expiry, in which case you do not get to specify the consumerKey and consumerSecret.   

This is changed in X/hybrid, so that you can do both in one request. 

BUT, I am not certain of this. I am not certain the newer admin payload is not ALSO supported on the latest OPDK.  The request format I have for X/hybrid uses expiresInSeconds, not keyExpiresIn. like this: 

 

POST :apigee/v1/organizations/:org/developers/:dev/apps/:app/keys/create
Authorization: Bearer :token
content-type: application/json

{
  "apiProducts": ["Product1", "Product1"],
  "consumerKey": "REQUIRED",
  "consumerSecret": "REQUIRED",
  "expiresInSeconds": "864000"
}

 

Can you try that?  I do not have an OPDK to try it on. 

Thanks for the info, Dino!

I am trying this on Apigee Edge. It looks like I need to upgrade to Apigee hybrid to achieve this.