Hi!
As an example, here it is a real response provided by the DO API:
{ “status”:“ERROR”, “error_message”:“Droplet is currently on. Please power it off to run this event.”, “message”:“Droplet is currently on. Please power it off to run this event.” }
My question is… How can I know in advance all of the possible error/success messages so I can translate them on the fly?
I cannot figure out how to force all of the error/success messages, and think it does not seem an elegant approach to go.
There is no information at all regarding this issue either in the API documentation or the community forum.
Please, note I cannot make use of the API response header status. If that were the case, then I would know everything went ok when getting a 200 and wrong in case I do not get a 200.
To make it clearer, I am not interacting with the API directly. All I get is a the API “error_message” string because theses responses are provided to me by a WHMCS addon.
Thanks you very much in advance for your assistance.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Unfortunately there is no additional documentation for API v1. I would suggest contacting the author of the WHMCS addon and seeing if it’s possible to modify the code to return the HTTP status in addition to the error message.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.