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

1

5

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.

Wilona answered 1/2, 2017 at 14:33 Comment(0)
W
7

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!

Wilona answered 2/2, 2017 at 9:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.