We’ve been using ServerPilot in conjunction with Digital Ocean to deploy apps for our development websites for a couple of years now. Whilst creating an app is extremely straightforward, we have started exploring how we can use the ServerPilot API to automate everything into a single command.
Using the following example from the docs:
$ curl https://api.serverpilot.io/v1/apps \
-u $CLIENTID:$APIKEY \
-H "Content-Type: application/json" \
-d '{"name": "gallery", "sysuserid": "RvnwAIfuENyjUVnl", "runtime": "php7.0", "domains": ["example.com", "www.example.com"]}'
Resulted in the following error message:
{"error": {"message": "You requested something that does not exist."}}
This error message was not that obvious and a quick Google search returned nothing of help. However, the solution was simple, make sure you use the actual user ID for sysuserid
. This is somewhat implied with the example but wasn’t immediately obvious!
To retrieve the exact ID, go to:
- Log into ServerPilot and click ‘Servers’
- Select the appropriate server
- Click ‘Users’ and select the user
- You’ll see the ID in the last path in the URL
Hopefully this saves others a few minutes of time!