Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-22982

[fiware-stackoverflow] Why am I receiving a "WRONG_SYNTAX" error when sending valid JSON to an API in Fiware IoT agent?

    Details

      Description

      Created question in FIWARE Q/A platform on 02-08-2024 at 15:08
      Please, ANSWER this question AT https://stackoverflow.com/questions/78825662/why-am-i-receiving-a-wrong-syntax-error-when-sending-valid-json-to-an-api-in-f

      Question:
      Why am I receiving a "WRONG_SYNTAX" error when sending valid JSON to an API in Fiware IoT agent?

      Description:
      I'm encountering an issue where my JSON request, which appears to be syntactically correct, is being rejected by an API with the following error message:
      `

      { "name": "WRONG_SYNTAX", "message": "Wrong syntax in request: Errors found validating request." }

      `

      Here is the JSON payload I'm sending:
      ` {
      "devices": [
      {
      "device_id": "temp005",
      "entity_name": "urn:ngsi-ld:Temp:005",
      "entity_type": "Temp",
      "timezone": "Europe/Berlin",
      "attributes": [

      { "object_id": "t", "name": "temperature", "type": "Text" }

      ,

      { "object_id": "e", "name": "event", "type": "Text" }

      ],
      "static_attributes": [

      { "name": "refroom", "type": "Relationship", "value": "urn:ngsi-ld:Room:001" }

      ]
      }
      ]
      }`

      I verified that the JSON is valid using a JSON validator. the headers are also as follow :
      `fiware-service = openiot
      fiware-servicepath = /
      Accept = application/json`

      I created a services group with this payload before :
      ` {
      "services": [

      { "apikey": "1068318794", "cbroker": "http://orion:1026", "entity_type": "Temp", "resource": "/iot/json" }

      ]
      }`

      and also provisioned a trusted service group with this payload before :
      `

      { "cbroker": "http://orion:1027", "trust": "c8fbc8ea1aabbadec48a61b8bb5dde01c77256d4" }

      `

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            newbacklogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: