How to handle my JSON string from Google Sheets API v4 in Java

Viewed 1611

I'm new to the Google Sheets API and it seems like I can't make any progress.

I have a Google Spreadsheet and I'm using the API with this URL to get the JSON data:

https://sheets.googleapis.com/v4/spreadsheets/spreadsheetId/values/01Jul2017!A1:T?key=APIkey

This will end up giving me something like this:

{
  "range": "'01Jul2017'!A1:T2828",
  "majorDimension": "ROWS",
  "values": [
    [
      "name",
      "school",
      "subschool",
      "descriptor"
    ],
    [
      "Acid Arrow",
      "conjuration",
      "creation",
      "acid"
    ],
    [
      "Air Walk",
      "transmutation",
      "",
      "air"
    ]
]
}

Now my problem is that I can't find how to handle my data. I'm used to reading JSON data with keys (e.g. "school":"conjuration") so I can use the following:

spell.setSchool(jsonObjectSpell.getString("school")); 

Can anyone help me out or just put me in the right direction?

2 Answers
Related