Question
Webhook JSON parse array
Hi All,
I am trying to parse a JSON response in order to implement error handling.
My response is
[{"message":"insufficient access rights on cross-reference id: 00QN00000012BjY","errorCode":"INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY","fields":[]}]
Note that an unreferenced array is returned ( [.....] ). If the response was {"errorCode":"errormsg"} then this would parse easily. However, I dont have control over the system returning the message so I need to parse an array.
How do I reference the errorCode?
I have tried:
[0].errorCode
errorCode[0]
[].errorCode
But nothing I try works. Has anyone come across this?
Thanks!
I am trying to parse a JSON response in order to implement error handling.
My response is
[{"message":"insufficient access rights on cross-reference id: 00QN00000012BjY","errorCode":"INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY","fields":[]}]
Note that an unreferenced array is returned ( [.....] ). If the response was {"errorCode":"errormsg"} then this would parse easily. However, I dont have control over the system returning the message so I need to parse an array.
How do I reference the errorCode?
I have tried:
[0].errorCode
errorCode[0]
[].errorCode
But nothing I try works. Has anyone come across this?
Thanks!