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

FIWARE.Question.Tech.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

        newbacklogmanager Backlog Manager created issue -
        newbacklogmanager Backlog Manager made changes -
        Field Original Value New Value
        Component/s FIWARE-TECH-HELP [ 10278 ]
        fla Fernando Lopez made changes -
        Assignee Jason Fox [ jason.fox ]
        fla Fernando Lopez made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        fla Fernando Lopez made changes -
        Status In Progress [ 3 ] Answered [ 10104 ]
        jason.fox Jason Fox made changes -
        Resolution Done [ 10000 ]
        Status Answered [ 10104 ] Closed [ 6 ]
        newbacklogmanager Backlog Manager made changes -
        Summary [fiware-stackoverflow] Why am I receiving a "WRONG_SYNTAX" error when sending valid JSON to an API in Fiware IoT agent? FIWARE.Question.Tech.Why am I receiving a "WRONG_SYNTAX" error when sending valid JSON to an API in Fiware IoT agent?.
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        6d 15h 2m 1 Fernando Lopez 11/Feb/25 8:45 AM
        In Progress In Progress Answered Answered
        2s 1 Fernando Lopez 11/Feb/25 8:45 AM
        Answered Answered Closed Closed
        138d 21h 59m 1 Jason Fox Monday 7:44 AM

          People

          • Assignee:
            jason.fox Jason Fox
            Reporter:
            newbacklogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: