1

I have the following Json file:

{ 
  "id": "04d925a8-c62a-4c28-83eb-21bfb879583a",
  "timestamp": "2017-05-07T10:23:05.165Z",
  "lang": "en",
  "result": {
    "source": "agent",
    "resolvedQuery": "fever",
    "action": "d",
    "actionIncomplete": false,
    "parameters": {
      "Disease": [
        "influenza"
      ],
      "Interest": "",
      "Search": "",
      "sick": "",
      "Symptom": [
        "Headache",
        "Stomach ache",
        "fever"
      ],
      "Use": "No"
    },
    "contexts": [],
    "metadata": {
      "intentId": "49ebecd7-4efd-421b-868e-5a97637ef749",
      "webhookUsed": "false",
      "webhookForSlotFillingUsed": "false",
      "intentName": "Doctor"
    },
    "fulfillment": {
      "speech": "I think you possible have the influenza with symptoms Headache, Stomach ache and fever, influenza, Headache, Stomach ache and fever",
      "messages": [
        {
          "type": 0,
          "speech": "I think you possible have the influenza with symptoms Headache, Stomach ache and fever, influenza, Headache, Stomach ache and fever"
        },
        {
          "type": 4,
          "payload": {
            "Google": {
              "attachment": {
                "type": "",
                "payload": {}
              }
            },
            "kik": {
              "type": "",
              "body": ""
            },
            "slack": {
              "text": "",
              "attachments": []
            },
            "telegram": {
              "text": ""
            },
            "viber": {
              "type": "text",
              "text": ""
            }
          }
        }
      ]
    },
    "score": 1
  },
  "status": {
    "code": 200,
    "errorType": "success"
  },
  "sessionId": "ba024d91-b309-4fa7-919c-6780e77f57e5"
}

but when i do json_decode in php it gives me an empty array. This means the Json is properly formatted. So i checked my json on the JsonLint json validator website. And i got an SyntaxError: Bad string on line 1 this is the first curly brace of the json file. Why is this incorrect? or do i have other mistakes in my json? Because i cant seem to find the problem. Any help is greatly appreciated.

6
  • you should remove this comment //this line give me the error when i check my json file. and try again. Commented May 7, 2017 at 10:54
  • i checked the json with out that line and then it gives me the error. it was just to make clear what line gives me the error :) Commented May 7, 2017 at 10:55
  • your JSON is valid check here json.parser.online.fr make sure to remove that comment. Commented May 7, 2017 at 10:56
  • 1
    try this eval.in/788752 Commented May 7, 2017 at 10:57
  • ok thanks! ill check if my code does something weird then Commented May 7, 2017 at 10:59

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.