Management API To get latest version of proxy

asharma377
Participant V

Hello,

is there not a management api /way to export the latest version by default.

Export managment api expects revision number in the path -

https://apidocs.apigee.com/management/apis/get/organizations/%7Borg_name%7D/apis/%7Bapi_name%7D/revi...

So we have to first get all revisions find the latest an then export that version

https://apidocs.apigee.com/management/apis/get/organizations/%7Borg_name%7D/apis/%7Bapi_name%7D/revi...

Thanks,
Aakash

Solved Solved
1 2 350
1 ACCEPTED SOLUTION

Hi Akash,

The steps you described are correct. I suggest you wrap this in a little script like:


LATEST_VERSION=$(curl -X GET --header "Authorization: Basic ****" "https://api.enterprise.apigee.com/v1/organizations/ORG/apis/API_NAME/revisions" | jq -r ".[-1]")

and then use the version variable for your export call.

View solution in original post

2 REPLIES 2

Hi Akash,

The steps you described are correct. I suggest you wrap this in a little script like:


LATEST_VERSION=$(curl -X GET --header "Authorization: Basic ****" "https://api.enterprise.apigee.com/v1/organizations/ORG/apis/API_NAME/revisions" | jq -r ".[-1]")

and then use the version variable for your export call.

okay thanks Daniel