This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Pingdom 2.1 and 3.1 apis don't work as documented

Using my trial account I am trying to eval the API to create a new "check" with the pingdom API 3.1 (or 2.1)

Here is the published documentation with the sample code I am following: Pingdom API (https://docs.pingdom.com/api/#tag/Resource:-Checks/paths/~1checks/post)

HERE IS MY POST: (response follows below)

------------------

curl -X POST \

  https://api.pingdom.com/api/3.1/checks \

  -H 'Accept: */*' \

  -H 'Accept-Encoding: gzip, deflate' \

  -H 'Authorization: Bearer REMOVED' \

  -H 'Cache-Control: no-cache' \

  -H 'Connection: keep-alive' \

  -H 'Content-Length: 459' \

  -H 'Content-Type: application/json' \

  -H 'Cookie: __cfduid=d9176e894c9e7447aaa6fe93b74da28e51569381518' \

  -H 'Host: api.pingdom.com' \

  -H 'Postman-Token: 31f0c5af-86db-4c7a-a9ed-56db4ddddad0,1194f682-4c16-4ba3-92d4-c761bb2919ae' \

  -H 'User-Agent: PostmanRuntime/7.16.3' \

  -H 'cache-control: no-cache' \

  -d '{

  "http": {

    "url": "https://pingdom.com",

    "encryption": true,

    "port": 443

  },

  "name": "mycheck1",

  "host": "pingdom.com",

  "type": "http",

  "paused": false,

  "resolution": 5,

  "sendnotificationwhendown": 2,

  "notifyagainevery": 0,

  "notifywhenbackup": true,

  "tags": [

    {

      "name": "pingdom",

      "type": "whatever",

      "count": 2

    }

  ],

  "probe_filters": [

    "region:LATAM"

  ],

  "responsetime_threshold": 30000

}'

HERE IS PINGDOM'S RESPONSE

----------------------------------------

{

   "error": {

   "statuscode": 400,

   "statusdesc": "Bad Request",

   "errormessage": "Invalid parameter: 'http'"

  }

}

Huh? I've even tried removing the 'http' object from the request above.... when I do that then I get back

{

   "error": {

   "statuscode": 400,

   "statusdesc": "Bad Request",

   "errormessage": "Invalid parameter value: paused"

  }

}

Huh? I've even tried removing the 'paused' property from the request above.... when I do that then I get back

{

   "error": {

   "statuscode": 400,

   "statusdesc": "Bad Request",

   "errormessage": "Invalid parameter value: notifywhenbackup"

  }

}

Huh? I've even tried removing the 'notifywhenbackup' property from the request above.... when I do that then I get back

{

   "error": {

   "statuscode": 400,

   "statusdesc": "Bad Request",

   "errormessage": "Invalid parameter tags value Array"

  }

}

Huh? I've even tried removing the 'tags' property from the request above.... when I do that then I get back

{

   "error": {

   "statuscode": 400,

   "statusdesc": "Bad Request",

   "errormessage": "Invalid parameter: filters"

  }

}

Huh? There is NO 'filters" property! Ok next best guess, I've even tried removing the 'probe_filters' property from the request above.... when I do that then I get back

{

   "check": {

   "id": 5454775,

   "name": "mycheck1"

  }

}

So.... what is going on here? the final request I posted looks like this.... a far cry from what the documentation states... Pingdom API

{

  "name": "mycheck1",

  "host": "pingdom.com",

  "type": "http",

  "resolution": 5,

  "sendnotificationwhendown": 2,

  "notifyagainevery": 0,

  "responsetime_threshold": 30000

}

  • The changes we are working on are not breaking which is why we can add it to our Public API version 3.1. Adding proper JSON support should not affect any existing integrations that our customers have, and since you are using URL-encoded parameters, you should be fine with the changes made. Once there's JSON support a user can choose to use that instead if they want to.

    Fetching teams and contacts is being worked on as well. It's in the team's sprint, we're enabling support for fetching teams and contacts via the Public API (and will be added to 3.1).

  • Great, and what about the GUI issue w/ the radio buttons vs checkboxes. The GUI does not properly reflect the actual regions bound via the API, and if you hit modify you change it to a single region which is not the intent.

  • Hey there bitsofinfo​, I just wanted to let you know that we have officially added JSON support as the request body schema in our Public API 3.1 and updated the documentation: https://docs.pingdom.com/api/.

    There's a description that is shown for the endpoints also -  the user can click the dropdown to see the 2 different ways of passing in the request body.

    Public API JSON.png

    Public API query string.png

    As for the API reflecting what's in the GUI, there isn't a 1:1 mapping and we are working through some of those issues.