Get Management API Upload Error Reason​

Not applicable

When uploading a .zip bundle of my proxy code after working on it in my local computer's IDE, sometimes the code is invalid due to improper structure, bad javascript, or a number of other reasons that aren't readily apparent.

If I upload through the UI, I get an informative message about the reason the code is invalid.

If I upload through the Management API through the build script we use, or from our deployment server, all I get is a 400: Bad Request as the response. Is there a way to get the detailed error message that appears in the UI? Our team's build practices are such that we don't want to be manually uploading code through the UI.

1 3 217
3 REPLIES 3

There is an additional query param you can pass into the upload api called validate which if should give you "better" information about why your upload failed.

See http://docs.apigee.com/management/apis/post/organizations/%7Borg_name%7D/apis-0 for more info

--Steve

Thank you, that worked. We needed to validate in our automated deployment scripts before other actions like updating a revision from source control. To achieve this, we now first make a call with validate=true and action=validate, which returns any errors. From there, we can continue deployment or log the error list and abort the deployment.

Hi @ncoury

Glad that fixed the issue. You could also have your build system call the Apigee Maven deploy plugin that helps in packaging and deploying API proxies from your code repo.

You can refer to the samples that are available in the repo. There are different options of deployment as well.

Also - please accept the answer if it resolved your issue