Complex JSON Deserialization

Hi All,

I am trying to find the solution in the existing answers but I keep hitting a brick wall. Below is an example JSON response I am getting from an API. All I want to be able to do is extract:
1 - Date of Birth
2 - All the questions and answers from the question array

Can anyone point me in the right direction, please?

{
   "exported" : null,
   "complete_by" : null,
   "workflow_id": 130,
   "brand_uuid": "09455868-a738-483b-afbb-012ed450f5f7",
   "candidate" : {
  "n_i_number" : "AB123456C",
  "last_name" : "Bloggs",
  "middle_name" : "",
  "uuid" : "85dec793-8cfc-4d36-8289-c5819bd95f65",
  "date_of_birth" : "1998-03-01",
  "first_name" : "Joe",
  "addresses" : [
     {
        "line_1" : "Basement Flat, 2",
        "country" : "GB",
        "to_present" : true,
        "line_2" : "Barons Court Road",
        "from_date" : "2013-03-10",
        "to_date" : null,
        "post_code" : "ID1 1QD",
        "id" : 626,
        "post_town" : "LONDON",
        "county" : "GREATER LONDON"
     }
  ],
  "email" : "joe@the-bloggs.com",
  "url" : "https://eu.safescreening.co.uk/candidates/85dec793-8cfc-4d36-8289-c5819bd95f65/",
  "contact_number" : "",
  "nationality" : "GB",
  "gender" : "m",
  "title" : "Mr"
   },
   "references" : [
  {
     "status" : "pending",
     "uuid" : "a43c9fdb-7107-4b7d-81bb-21e4b7198fd4",
     "has_document" : false,
     "claims" : [
        {
           "course_studied" : "",
           "end_date" : null,
           "corrected_start_date" : null,
           "corrected_course_studied" : "",
           "corrected_grade_achieved" : "",
           "position" : "",
           "corrected_position" : "",
           "notes" : "",
           "selected_claim_type" : "",
           "grade_achieved" : "",
           "corrected_end_date" : null,
           "organisation" : "Ref Org",
           "status" : "pending",
           "start_date" : "1997-03-30",
           "id" : 795,
           "department" : ""
        }
     ],
     "referees" : [
        {
           "period_known" : "",
           "postal_address" : "",
           "position" : "",
           "contact_number" : "+447870604936",
           "do_not_contact" : false,
           "department" : "",
           "email" : "referee@reforg.com",
           "organisation" : "Ref Org",
           "relationship" : "",
           "id" : 953,
           "name" : "Sample Referee",
           "fax_number" : "",
           "referencerequest": {
               "uuid": "4dbab81b-93ea-49c2-841d-140a9ecd6cee",
               "sent": "2015-08-20T16:33:39",
               "status": "responded",
               "referenceresponse": {
                   "id": 358,
                   "received": "2015-08-20T17:12:01",
                   "acknowledgement_agreed": "I confirm that I am the named referee, Sample Referee, and that the above information is correct to the best of my knowledge.",
                   "optionalreferenceinfo": {
                       "question_1": "Why did this person leave your employment?",
                       "answer_1": "This person was a temporary member of staff",
                       "question_2": "If appropriate, would you hire this person again?",
                       "answer_2": "If we had the funding to renew the role, yes we would",
                       "question_3": "Any further comments:",
                       "answer_3": "",
                       "question_4": "",
                       "answer_4": "",
                       "question_5": "",
                       "answer_5": "",
                       "question_6": "",
                       "answer_6": "",
                       "question_7": "",
                       "answer_7": "",
                       "question_8": "",
                       "answer_8": "",
                       "question_9": "",
                       "answer_9": "",
                       "question_10": "",
                       "answer_10": "",
                       "question_11": "",
                       "answer_11": "",
                       "question_12": "",
                       "answer_12": "",
                       "rating_area_1": "Time Keeping",
                       "rating_1": "excellent",
                       "rating_area_2": "Flexibility",
                       "rating_2": "excellent",
                       "rating_area_3": "Honesty & Integrity",
                       "rating_3": "excellent",
                       "rating_area_4": "Technical Knowledge",
                       "rating_4": "good",
                       "rating_area_5": "Communication",
                       "rating_5": "good",
                       "rating_area_6": "",
                       "rating_6": "",
                       "rating_area_7": "",
                       "rating_7": "",
                       "rating_area_8": "",
                       "rating_8": "",
                       "rating_area_9": "",
                       "rating_9": "",
                       "rating_area_10": "",
                       "rating_10": "",
                       "rating_area_11": "",
                       "rating_11": "",
                       "rating_area_12": "",
                       "rating_12": ""
                   }
               }
           },
        }
     ],
     "rejected_reason" : "",
     "reference_type" : "employment"
  }
   ],
   "started" : "2016-03-10T15:53:41",
   "supplied_documents" : [
  {
     "id" : 1904,
     "acknowledged" : true,
     "requires_acknowledgement" : true,
     "type" : {
        "name" : "T&Cs",
        "id" : 108,
        "auto_reject_expired" : false,
        "help_text" : "",
        "has_document" : true,
        "has_expiry_date" : true,
        "expiry_notification_threshold" : 14
     }
  },
  {
     "acknowledged" : false,
     "id" : 1906,
     "type" : {
        "expiry_notification_threshold" : 14,
        "has_document" : true,
        "has_expiry_date" : true,
        "help_text" : "Some help text",
        "auto_reject_expired" : false,
        "id" : 106,
        "name" : "Test document One"
     },
     "requires_acknowledgement" : false
  }
   ],
   "reference" : "",
   "url" : "https://eu.safescreening.co.uk/backgroundchecks/827/",
   "completed" : null,
   "questions" : [
    {
        "name": "Example Dynamic Question",
        "type": "dynamic",
        "group": 33,
        "include_in_report": true,
        "lineup": 1.0,
        "question": "Yes or no",
        "answer_1": "Yes",
        "answer_2": "No",
        "answer_3": "",
        "answer_4": "",
        "answer_5": "",
        "answer_6": "",
        "notes_settings": "header_and_area",
        "notes_header": "If yes why?",
        "answer": {
            "answer": "1",
            "notes": "Reasons for Yes"
        }
    }
   ],
   "status" : "open",
   "tags": [
    {
        "tag": "9001",
        "tag_type": 42,
        "tag_type_name": "Number Tag",
        "datatype": "number",
        "preset_tag": null,
        "regex": null
    },
    {
        "tag": "A1",
        "tag_type": 87,
        "tag_type_name": "Regex Tag",
        "datatype": "regex",
        "preset_tag": null,
        "regex": '[A-Z][0-1]'
    },
    {
        "tag": "1999-01-01",
        "tag_type": 86,
        "tag_type_name": "Date Tag",
        "datatype": "date",
        "preset_tag": null,
        "regex": null
    }
]
}

Hey Gerard.

You don’t specify on how you hit the wall of bricks.

My guess is, that’s the json array “referees”.

I’ve solved for that here, https://youtu.be/tapmE5YiO8Y Let me know, if that helps you :slight_smile: