in Server

ServerPilot API “You requested something that does not exist” when creating an app

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:

  1. Log into ServerPilot and click ‘Servers’
  2. Select the appropriate server
  3. Click ‘Users’ and select the user
  4. You’ll see the ID in the last path in the URL

Hopefully this saves others a few minutes of time!

Write a Comment

Comment