I am trying to parse a JSON which I get after doing a post call in the cloud page, The returned JSON is nested and I can't access it, I have tried the GLT but it is not working. This is my JSON :
{
"message": {
"links": {
"self": {
"href": "/v1/emails/1734
}
},
"views": [
{
"contentType": "vnd.exacttarget.message.email.htmlBody",
"content": “Hello”
}
]
}
}
I am trying to extract parse the content and then be able to display it.
I have tried the following code :
{{.datasource JSONVar type=variable maxRows = 20}}
{{.data}}
{"target" : "@accesstoken"}
{{/data}}
{{.datasource message type=nested maxRows = 20}}
{{.data}}
{ "target" : "JsonVar.message" }
{{/data}}
<br>JsonCustomer.links: {{links}}
{{.datasource Jsonviews type=nested maxRows = 20}}
{{.data}}
{ "target" : "message.views" }
{{/data}}
<br>Jsonviews.contentType: {{contentType}}
<br>Jsonviews.content: {{content}}
%%[
var @content
]%%
<br>Hello %%=v(@content)=%%
<hr>
{{/datasource}}
{{/datasource}}
{{/datasource}}
@accesstoken is the JSON. Any help is appreciable, thank you