Management API To get latest version of proxy

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/revisions/%7Brevision_number%7D

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/revisions

Thanks,
Aakash

1 Like

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.

1 Like

okay thanks Daniel