function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
PseudodarwinistPseudodarwinist 

Getting error 'Unexpected character (' 1 ' (code 49)): was expecting comma to separate OBJECT entries at [line:1', column: 920]while receiving response from an integration

Getting error 'Unexpected character (' 1 ' (code 49)): was expecting comma to separate OBJECT entries at [line:1',     column: 920],while receiving response from an integration.Any immidiate help is appreciated.
Below is the JSON response:
{
  "success": true,
  "diaryInfo": {
    "createDate": "2018-06-04T12:07:00Z",
    "closeDate": "2018-06-05T14:09:00Z",
    "claimInvestigationDate": "2018-06-04T00:00:00Z"
  },
  "delayedBagGroup": {
    "bagWeight": "1/20",
    "delivery": {
      "deliveryAddress": {
        "addressLine": [
          {
            "addressLineDesc": "VIA DELL ANGUILLARA N18",
            "seq": "1"
          }
        ],
        "city": "FLORENCE",
        "state": {
          "stateName": "TOSCANA"
        },
        "postalCode": "50122",
        "country": {
          "countryCode": "IT"
        }
      },
      "localDeliveryInfo": [
        {
          "dlvInfo": "TO PERMANENT ADDRESS",
          "seq": "1"
        },
        {
          "dlvInfo": "NUMERO 11",
          "seq": "2"
        }
      ],
      "deliveryService": [
        {
          "deliveryServiceDesc": "FLR27702/05JUN/TA01/TC01/YT01/LD01/PN01/CP01/TN01/CT01/UP15",
          "seq": "1"
        }
      ]
    },
    "delayedBags": [
      {
        "colourAndType": {
          "suspended": false,
          "colourCode": "GY",
          "typeCode": "22",
          "descriptor": {
            "otherElement": [
              "H",
              "W",
              "X"
            ]
          }
        },
        "bagTag": {
          "suspended": false,
          "airlineCode": "IB",
          "tagSequence": "050906"
        },
        "brandInfo": {
          "suspended": false,
          "brandInfo": "YY/MEDIUM SIZE"
        },
        "bagDelivery": {
          "status": {
            "trackingUpdate": ":17"
          },
          "deliveredTime": "2018-06-05T00:00:00+00:00"
        },
        "bagContents": {
          "suspended": false,
          "content": [
            {
              "category": "COSMETICS",
              "description": "HEAD AND SHOULDERS SHAMPOO\nGARNIER CONDITIONER"
            },
            {
              "category": "DRESS",
              "description": "WHITE SHIRTS BLACK SHIRTS"
            }
          ]
        }
      }
    ],
    "bagLastSeen": "JFK",
    "bagItinerary": {
      "flightDateOrARNK": [
        {
          "flightDate": {
            "airlineCode": "IB",
            "flightNumber": "6252",
            "flightDate": "2018-06-03"
          }
        },
        {
          "flightDate": {
            "airlineCode": "IB",
            "flightNumber": "3258",
            "flightDate": "2018-06-04"
          }
        }
      ]
    },
    "bagTagDestinations": {
      "station": [
        {
          "stationValue": "FLR"
        }
      ]
    },
    "keysCollected": false,
    "missingWeight": "1/20"
  },
  "passengers": {
    "names": [
      {
        "name": "ARAUZ",
        "seq": "1"
      }
    ],
    "initials": [
      {
        "initial": "AY",
        "seq": "1"
      }
    ],
    "title": "M YEREMY",
    "contactInfo": {
      "permanentAddress": {
        "addressLine": [
          {
            "addressLineDesc": "269 W 113ST APT 3A",
            "seq": "1"
          }
        ],
        "city": "NEW YORK",
        "country": {
          "countryCode": "US"
        }
      },
      "temporaryAddress": {
        "addressLine": [
          {
            "addressLineDesc": "B E B VIA DELL'ANGUILLARA 18",
            "seq": "1"
          }
        ],
        "city": "FIRENZE",
        "country": {
          "countryCode": "IT"
        },
        "validityDate": "2018-06-08"
      },
      "permanentPhones": [
        {
          "phone": "0019292280016",
          "seq": "1"
        }
      ],
      "cellPhones": [
        {
          "phone": "0013477210696",
          "seq": "1"
        },
        {
          "phone": "1-9292280016",
          "seq": "2"
        }
      ],
      "temporaryPhones": [
        {
          "phone": "39-0013477210696",
          "seq": "1"
        }
      ],
      "emails": [
        {
          "email": "YEREMYARAUZ@GMAIL.COM",
          "seq": "1"
        }
      ],
      "country": {
        "countryCode": "US"
      }
    },
    "language": "EN",
    "ticketNumber": "0757086214010",
    "pnr": "WB2GWE",
    "autoMessageOption": "SMS_AND_EMAIL",
    "passportInfo": "PASS 579618976",
    "itinerary": {
      "flightSegmentsorARNK": [
        {
          "flightAmend": {
            "flightAndDate": {
              "airlineCode": "IB",
              "flightNumber": "6252",
              "flightDate": "2018-06-03"
            },
            "originDestination": {
              "origin": "JFK",
              "destination": "MAD"
            }
          }
        },
        {
          "flightAmend": {
            "flightAndDate": {
              "airlineCode": "IB",
              "flightNumber": "3258",
              "flightDate": "2018-06-04"
            },
            "originDestination": {
              "origin": "MAD",
              "destination": "FLR"
            }
          }
        }
      ]
    },
    "status": "Y",
    "givenName": "YEREMYANGEL"
  },
  "additionalInfo": {
    "miscellaneousInfo": [
      {
        "miscInfoText": "IB050906 INSERITO IN AQS    05/06 - 5 IL 05/06 15:02",
        "seq": "1"
      },
      {
        "miscInfoText": "AG IBS",
        "seq": "2"
      },
      {
        "miscInfoText": "BAG IB050906 CLCTD BY AQS AT 05/06 15:17 AG GRAZIO",
        "seq": "3"
      },
      {
        "miscInfoText": "BAG IB050906 DISPO - 06/06 19:31 AGY1M",
        "seq": "4"
      },
      {
        "miscInfoText": "BAG BROUGH BACK BY AQS , PAX NO FOUND NO ANSWER ON PN",
        "seq": "5"
      },
      {
        "miscInfoText": "BAG IB050906 CLCTD BY PAX ARAUZ YEREMY 06/06 20:58",
        "seq": "6"
      },
      {
        "miscInfoText": "DOC PASS USA 579618976 AG AGO",
        "seq": "7"
      }
    ],
    "deliveryInfo": [
      {
        "deliveryInfoText": "WM BDO AHL FLRIB10185  /1323GMT/05JUN18\nDS FLR27702 - AQS 0039 02 55305884\nAEROPORTO AMERIGO VESPUCCI SERVIZIO RICONSEGNA BAGAGLI\nAMERIGO VESPUCCI BAGGAGE DELIVERY SERVICE\nUP 15:17\nNM01 ARAUZ\nTA B E B VIA DELL'ANGUILLARA 18\nYT FIRENZE\nTC IT\nDD 05JUN\nCP01 0013477210696 .PN01 0019292280016\nLD01 TO PERMANENT ADDRESS\nTN01 IB050906\nCT01 GY22\n /RECHARGE - /SIGNATURE FOR RECEIPT OF 1 BAG .RT\nTX   .AG QUEUEWT\nCW WWW/D/AQSSRL/D/IT\n",
        "seq": "1"
      }
    ],
    "messageInfo": [
      {
        "messageInfoText": "WM TTY FLRLLXH 06JUN18/1810GMT\nAHL FLRIB10185\n.QLMIBAP\nPLEASE CHECK THAT THIS BAG IS DELIVERED\nPAX CALL SAYING THAT THE BAG DID NOT ARRIVE\nCONTACT WITH PAX AND DO A NEW DELIVER PELASE\nTHANK YOU\n",
        "seq": "1"
      }
    ]
  },
  "claim": {
    "claimData": {
      "passengerPayments": {
        "passengerPaymentsValue": [
          {
            "costType": "F",
            "amount": {
              "amount": 0,
              "currencyCodeValue": "EUR"
            }
          }
        ]
      },
      "faultStationCode": "MAD",
      "insuranceIndicator": false,
      "liabilityTagIndicator": false,
      "partnerCode": {
        "none": true
      },
      "lossReasonCode": "56",
      "toiletKitsMale": "0"
    }
  },
  "internetInfo": [
    {
      "internetInfoText": "05JUN/1721GMT /INTERNET MESSAGE FROM WORLDTRACER\nREF  FLRIB10185\nI AM IN FLORENCE AND I NEED MY BAG AS SOON AS PODSIBLE.\n",
      "seq": "1"
    }
  ],
  "emailInfo": [
    {
      "emailInfoText": "05JUN/1323GMT 277 YEREMYARAUZ/A/GMAIL/D/COM\nDear Customer\nThis message is system generated automatically.\nPlease do not reply to this e-mail.\nBaggage Delivery Order Created by FLR - IBERIA\nAQS 0039 02 55305884\nNumber of Bags in Delivery:  1\nDate Delivered:              05JUN\nPassenger Name:              ARAUZ\nTelephone Numbers:           Permanent:  0019292280016\n                             Cell/Mobile: 0013477210696\nBag - 1  Type 22:            UPRIGHT DESIGN SOFT MATERIAL\nColour:                      GREY\nCourier Pickup:              :17\nTag Details:                 IB050906\nADVICE TO CUSTOMER - PLEASE NOTE\nOnce your baggage has been picked up by the courier it\nwill be delivered to the address provided. Please be\naware that this can take a variable amount of time\ndepending upon the number of bags to be delivered as well\nas the time of the day.  Please be assured that we will\nendeavor to deliver your baggage as promptly as possible.",
      "seq": "1"
    }
  ],
  "recordHistory": {
    "history": [
      "AHL  04JUN/1207GMT AG 037574/09410 FROM WM BY IB",
      "AAH  04JUN/1244GMT /277 AG AGO WWS ELEMENTS BI01/BL01/BW01/\n     CT01 GY01XXX/DB01/NW01/LD01/BR01/CO01/DV01/\n     PA01 TEMP_ADDRESS/PN01/PP01/PS01/PT01/TP01/TC01/YP01/YT01/",
      "CAC  04JUN/1244GMT /277 MATCHING-NONE AG SITA  FROM AUTOFEED",
      "AAH  04JUN/1711GMT /IB AG INTERNETUSER PAXINET ELEMENTS\n     DA01/LD01 TO PERMANENT ADDRESS/SD01/ZD01/ND01/YD01/",
      "AAH  04JUN/1748GMT /IB AG INTERNETUSER PAXINET ELEMENTS\n     DA01/",
      "AAH  04JUN/1749GMT /IB AG INTERNETUSER PAXINET ELEMENTS\n     DA01/LD01 TO DELIVERY ADDRESS/LD02/SD01/",
      "AAH  04JUN/1752GMT /IB AG INTERNETUSER PAXINET ELEMENTS\n     AM01/CP01 0013477210696/PN01 0019292280016/\n     TP01 0013477210696/CP02/",
      "AAH  05JUN/1027GMT /277 AG BMW WWS ELEMENTS CC01/",
      "AAH  05JUN/1323GMT /277 AG QUEUEWT WWS ELEMENTS DD01/",
      "AAH  05JUN/1323GMT /277 AG QUEUEWT WWS ELEMENTS\n     FF01/FF02/FF03/",
      "BDO  05JUN/1323GMT /277 AG QUEUEWT WWS\n     TA01/CP01 39-0013477210696/PN01 1-9292280016/LD01 NUMERO 11/DS01/UP01/DY01/",
      "SMS  05JUN/1323GMT /277 /501976/FROM AUTO SMS/CP 0013477210696/\n     FLRIB10185 - Delivery Info: No of Items: 1 Courier: AQS 0039 02 55305884 Pick-Up: :17",
      "SMS  05JUN/1323GMT /IB /502001/FROM AUTO SMS/CP 1-9292280016/\n     FLRIB10185 - Delivery Info: No of Items: 1 Courier: AQS 0039 02 55305884 Pick-Up: :17",
      "SEA  05JUN/1323GMT /277/ FROM AUTO SEA/ SE YEREMYARAUZ/A/GMAIL/D/COM\n     Dear Customer\n     This message is system generated automatically.\n     Please do not reply to this e-mail.\n     Baggage Delivery Order Created by FLR - IBERIA\n     AQS 0039 02 55305884\n     Number of Bags in Delivery:  1\n     Date Delivered:              05JUN\n     Passenger Name:              ARAUZ\n     Telephone Numbers:           Permanent:  0019292280016\n                                  Cell/Mobile: 0013477210696\n     Bag - 1  Type 22:            UPRIGHT DESIGN SOFT MATERIAL\n     Colour:                      GREY\n     Courier Pickup:              :17\n     Tag Details:                 IB050906\n     ADVICE TO CUSTOMER - PLEASE NOTE\n     Once your baggage has been picked up by the courier it\n     will be delivered to the address provided. Please be\n     aware that this can take a variable amount of time\n     depending upon the number of bags to be delivered as well\n     as the time of the day.  Please be assured that we will\n     endeavor to deliver your baggage as promptly as possible.",
      "SMS  05JUN/1323GMT /XS /501976/STATUS/\n     DELIVERED TO PAX",
      "SMS  05JUN/1323GMT /XS /502001/STATUS/\n     DELIVERED TO PAX",
      "AAH  05JUN/1409GMT /277 AG Z5Y WWS ELEMENTS RL01/FS01/CS02/",
      "CFI  05JUN/1409GMT /277 AG Z5Y WWS",
      "AAH  05JUN/1721GMT /IB AG INTERNETUSER PAXINET ELEMENTS\n     IR01/",
      "TTY  06JUN/1810GMT FLRLLXH",
      "AAH  06JUN/1859GMT /277 AG QUEUEWT WWS ELEMENTS\n     FF04/FF05/FF06/FF07/"
    ]
  },
  "recordStatus": "CLOSED",
  "smsinfo": [
    {
      "seq": "1",
      "smsinfoText": "05JUN/1323GMT /277 /501976/FROM AUTO SMS/CP 0013477210696/\nFLRIB10185 - Delivery Info: No of Items: 1 Courier: AQS 0039 02 55305884\nPick-Up: :17"
    },
    {
      "seq": "2",
      "smsinfoText": "05JUN/1323GMT /IB /502001/FROM AUTO SMS/CP 1-9292280016/\nFLRIB10185 - Delivery Info: No of Items: 1 Courier: AQS 0039 02 55305884\nPick-Up: :17"
    }
  ]
}
 
 
Narender Singh(Nads)Narender Singh(Nads)
Hi Chetan,
I figured out what the problem is.
In your JSON response there is a single quote.

Solution:
//Say you are storing in a variable called res. like this:
Httpresponse res=http.send(request);
//Now do as shown in the code to replace the single quote:
String jsonresponse= res.getbody().replace('\'', '\\\'');

Let me know if it helps.
PseudodarwinistPseudodarwinist
Sure..Thanks Narender for your help!Will try the suggestion.