iotcreators.com web
    • Login
    • Search
    • forum.iotcreators.com
    • docs.iotcreators.com
    • Tags
    • Popular
    • Recent
    • Register

    API response "Invalid Json format" code 1011

    iotcreators.com portal & API
    api authentication error code 1005 invalid json format code 1011
    3
    6
    304
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      GrandPep last edited by

      Hello,

      I am trying to send a downlink message to our devices. First I followed the documentation of “6: Send message to devkit” by which I used postman with the following results:

      {{base_url}} = api.scs.iot.telekom.com
      {{user:pass}} = base64 of the given API credentials user:pass
      {{IMEI}} = one of our registered IMEI’s

      PUT: https://{{base_url}}/m2m/endpoints/IMEI:{{IMEI}}/downlinkMsg/0/data
      HEAD: Content-Type: application/json
      HEAD: Authorization: Basic {{user:pass}}
      BODY RAW:
      {
      “resourceValue”: “48656c6c6f20446576696365”
      }

      RESPONSE:
      {
      “msg”: “Authentication error”,
      “code”: “1005”
      }

      Afterwards I read in a different part of the documentation in “GETTING SERIOUS - IOTCREATORS.COM - Using the API” that first, a callback needs to be registered, which we deed and got a “msg”: “Success” response and I retried the previous call with the following response:

      {
      “msg”: “Invalid Json format”,
      “code”: 1011
      }

      Why do I get this error?

      afzal_m 1 Reply Last reply Reply Quote 0
      • afzal_m
        afzal_m iotcreators.com team @GrandPep last edited by

        @grandpep

        I just reached out to @Roalnd-Baldin, he will post something on Monday

        1 Reply Last reply Reply Quote 0
        • Roland Baldin
          Roland Baldin iotcreators.com team last edited by

          @GrandPep Hi, normally you should get the “Invalid Json format” only if something is wrong with the JSON in the HTTP body.

          Can you please provide the HTTP code snippet which you get displayed in Postman when you click the “</>” symbol on the very right side of the Postman window ?

          Please make sure that you change the Authorization tokoen oand the IMEI before you share it with us.

          Many thanks!
          Roland

          G 3 Replies Last reply Reply Quote 0
          • G
            GrandPep @Roland Baldin last edited by GrandPep

            @roalnd-baldin Hello Roland, thank you for your help. I think I already found the problem: it seems that postman used an older cookie received from IoTcreators with which it returned the “Invalid Json format” error (altough I have no idea why a wrong cookie would cause such an error) but after removing all cookies, I received a new cookie and all seems to work now.

            1 Reply Last reply Reply Quote 0
            • G
              GrandPep @Roland Baldin last edited by

              @roalnd-baldin No it was not the cookie unfortunately… I simply read the wrong reply (of the registration) in my last response, sorry about that… The error still exists and the HTTP snippet is:

              curl --location --request PUT ‘https://api.scs.iot.telekom.com/m2m/endpoints/IMEI:<IMEI NUMBER>/downlinkMsg/0/data’
              –header ‘Content-Type: application/json’
              –header ‘Authorization: Basic <BASE64 user:pass>’
              –data-raw ‘{
              “resourceValue”: “48656c6c6f20446576696365”
              }’

              1 Reply Last reply Reply Quote 0
              • G
                GrandPep @Roland Baldin last edited by GrandPep

                @roalnd-baldin It seems to work with curl in command if the data-raw is rewritten like so:

                –data-raw “{
                \“resourceValue\”: \“48656c6c6f20446576696365\”
                }”

                In command we get a nice “msg”:“Accepted”,“code”:1002 response but in Postman it does not work. And with the registration to https://{{base_url}}/m2m/applications/registration this was not an issue.

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                • First post
                  Last post