13 Replies Latest reply on Oct 14, 2019 9:12 AM by matt.pitcher

    Pingdom 2.1 and 3.1 apis don't work as documented

    bitsofinfo

      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

      }

        • Re: Pingdom 2.1 and 3.1 apis don't work as documented
          matt.pitcher

          Hello bitsofinfo . Thank you so much for the feedback. This is obviously quite embarrassing and somehow slipped through our QA. I deeply apologize for the issues. Thank you for catching and reporting them. Our developers are currently working on a fix:

           

          We’re fixing the documentation now. In short, our quick recommendation is to use urlencoded parameters instead of JSON (as described in examples in the old documentation: https://www.pingdom.com/api/2.1/). Soon the new docs (docs.pingdom.com/api) will also have urlencoded parameters in the examples.

           

          Once we fix and complete the handling of JSON we’ll describe that in the docs to reflect that as well.

           

          Please let me know if you have any further questions. Thank you again for calling this out to us.

           

          - Matt Pitcher, PM, Pingdom

            • Re: Pingdom 2.1 and 3.1 apis don't work as documented
              bitsofinfo

              Just was about to go to tweet you guys as I was concerned nobody was paying attention. Thanks for the reply

               

              Glad to hear I wasn't going nuts and that its being remedied, I contacted support and they were trial/erring through the process as well.

               

              It appears completely non-functional.

               

              FYI the swagger docs even for 2.1 (as of a day ago) described JSON that also didn't work.

               

              In any case, please post an update here when 3.1 is ready. Looking to build something new, and don't want to build against an old API.

               

              thanks