hadi gheitasi
hadi gheitasi

Reputation: 11

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

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"
    }`

Upvotes: 1

Views: 34

Answers (0)

Related Questions