Report this

What is the reason for this report?

API Returning Error

Posted on January 30, 2019

I set up an OpenVPN server on my Ubuntu 18.10 VPS, which is working perfectly. In an attempt to lower the cost, I’m trying to set up scripts that run when my PC is booted and when it’s logged out of that turn on and off the VPS respectively, since I won’t be using it when my PC is off. I created a basic batch script to do so using cURL(which apparently is included in the Windows 10 Command Prompt) to call the DO API. I copied the example cURL request from the API docs verbatim, replacing the API token and the droplet ID, and it returned {"id":"bad_request","message":"Your request body was malformed."} To ensure that authentication was working, I typed some random nonsense as the API token, which of course returned {"id": "unauthorized", "message": "Unable to authenticate you." } I have no idea why it’s not working, any ideas?



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!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.