How to parse this type of JSON Data?



  • Just curious to how i'll parse this type of JSON Data without doing L/R String Parsing!

    FYI : Regular JSON Parsing doesn't work.

    gigya.callback({
      "callId": "40c5c2d4329d4e5fb65b1a987a07166e",
      "context": "",
      "errorCode": 0,
      "apiVersion": 2,
      "statusCode": 200,
      "statusReason": "OK",
      "time": "2020-09-15T18:01:08.126Z",
      "registeredTimestamp": 1600190073,
      "UID": "c6c43866a1b04806926d569a922436f0",
      "UIDSignature": "nr3PnR/IrGE+/t4pSP3f8cWzE0Y=",
      "signatureTimestamp": "1600192868",
      "created": "2020-09-15T17:14:33.354Z",
      "createdTimestamp": 1600190073,
      "data": {
        "ccpaConsent": true,
        "MarketingOptIn": "true",
        "preferredLocationName": "Metairie",
        "profile": {
          "birthDate": "1996-02-18"
        },
        "loyalty": "true",
        "isMobile": true,
        "preferredLocation": "2403",
        "changeLocation": "Metairie"
      },
      "subscriptions": {},
      "preferences": {},
      "emails": {
        "verified": [],
        "unverified": [
          "[email protected]"
        ]
      },
    
    



  • Admin

    First of all you need to parse everything between gigya.callback( and the corresponding ) that you didn't include. Then you can use normal json parsing or jtokens.



  • @Ruri Agh thanks, I swear I tried that and it wasn't parsing the values, but it works now.


Log in to reply