My rest API returns something like:
{"UserInfo":[{"userName":"zbradford","firstName":"Zoe","lastName":"Bradford","emailAddress":"ZBradford@ABC.COM"}]}
I would like to let it return only the email address value: ZBradford@ABC.COM
Here is my code:
import groovy.json.JsonSlurper;
def slurper = new JsonSlurper()
def jsonResponse = slurper.parseText(resp)
jsonResponse.UserInfo.emailAddress.join(',')
I got a java null error, any suggestion on my code? Thanks