Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pausing a Pingdom check via the Pingdom API using curl (BASH)

Tags:

bash

curl

pingdom

Here is my curl command:

curl -X PUT -u 'adminaccount:teampassword' -H 'Content-Type: application/json' -H 'App-Key: appkey' -d 'paused=true' https://api.pingdom.com/api/2.0/checks/checkID

I get the following error when passing through the admin account (the account which stores our checks):

{"error":{"statuscode":401,"statusdesc":"Unauthorized","errormessage":"Invalid email and/or password"}}

If I change the username I'm passing through to my teams account (non-admin, no checks locally) I get the following error:

{"error":{"statuscode":403,"statusdesc":"Forbidden","errormessage":"Not permitted for account type."}}

This suggests to me that I need to include multi-user authentication, however I can't find any documentation explaining how to do this via a curl command.

Any help would be appreciated.

like image 824
jto Avatar asked Feb 01 '17 14:02

jto


1 Answers

For anyone who comes across this problem, I have found a resolution. It is because in my particular case all of my Pingdom checks have been configured on the admin account. I obviously don't have access to the password for that account so I have to add the following:

-H "account-email: [email protected]"

So my cURL is now:

curl -X PUT -u [email protected]:Password -H "account-email: [email protected]" -H 'Content-Type: application/json' -H 'App-Key: appkey' -d 'paused=false' https://api.pingdom.com/api/2.0/checks/2328054

Hope this can help someone!

like image 83
jto Avatar answered Oct 15 '22 18:10

jto