Groovy web console

subscribe to the feed Subscribe
to this
parse json to get token (via #groovywebconsole)
tweet this snippet Tweet

parse json to get token

Published 1 year ago by nmrao with tags parse json
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def response = """{
  "accessToken": "fjskjlkdkkfjsfk98294239482",
  "status": {
    "code": 0,
    "message": null
def parsedJson = new groovy.json.JsonSlurper().parseText(response)
println parsedJson.accessToken