Hi ,
I am trying to create new api proxy/update revision in APigeeX from rest mgmt api as per the documentation but it returns 404 or 400 for following calls, what the right url and payload to invoke these endpoints.
- creating api proxy not the revision:
https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.apis/create
curl -X “POST” -H “authorization: Bearer $token” -H “Content-Type: multipart/form-data” -F “file=@/Users/name/Downloads/campaigns_rev5_2022_02_05.zip” https://apigee.googleapis.com/v1/organizations/apg-org/apis?action=import&name=campaigns
Request body: not sure why api documentation show this when it’s the zip bundle thats to be uploaded as form-data/octet-stream.
as per docmentation, which doesn’t make sense as this should be zip bundle: :
{
“contentType”: “”,
“data”: “”,
“extensions”: [
{}
]
}
What would be the sample request url and paylaod be for octet-stream, is following correct:
curl -X “POST” -H “authorization: Bearer $token” -H “Content-Type: application/octet-stream” -F “file=@campaigns_rev5_2022_02_05.zip” https://apigee.googleapis.com/v1/organizations/apg-org/apis?action=import&name=campaigns
- updating the existing proxy by uploading zip
What’s the sample payload for this request?
https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.apis.revisions/updateApiProxyRevision
I tried following
a)
curl -X PUT ‘https://apigee.googleapis.com/v1/organizations/apg-org/environments/qa/apis/pingstatus-v1/revisions/8’ -H “authorization: Bearer $token” -H “Content-Type=application/octet-stream”
as per docmentaiton, which doesn’t make sense as this should be zip bundle:
{
“contentType”: “”,
“data”: “”,
“extensions”:
}
b)
curl -X PUT ‘https://apigee.googleapis.com/v1/organizations/apg-org/environments/qa/apis/pingstatus-v1/revisions/8?name=pingstatus-v1’ -H “authorization: Bearer $token” -H “Content-Type=multipart/form-data” -F “file=@pingstatus-v1_rev5_2022_02_05.zip”
c)
curl -X PUT ‘https://apigee.googleapis.com/v1/organizations/apg-org/environments/qa/apis/pingstatus-v1/revisions/8?name=pingstatus-v1’ -H “authorization: Bearer $token” -H “Content-Type=application/octet-stream” -F “file=@pingstatus-v1_rev5_2022_02_05.zip”