You need to sign in to do that
Don't have an account?

Help regarding parsing json response
Hello,
could some one help me in parsing the below json,
{
"d": {
"results": [
{
"__metadata": {
"id": "https://testasugo.sharepoint.com/_api/Web/GetFolderByServerRelativePath(decodedurl='/Shared Documents/Salesforce/Salesforcetwo')",
"uri": "https://testasugo.sharepoint.com/_api/Web/GetFolderByServerRelativePath(decodedurl='/Shared%20Documents/Salesforce/Salesforcetwo')",
"type": "SP.Folder"
},
"Name": "Salesforcetwo"
},
{
"__metadata": {
"id": "https://testasugo.sharepoint.com/_api/Web/GetFolderByServerRelativePath(decodedurl='/Shared Documents/Salesforce/sub Salesforce')",
"uri": "https://testasugo.sharepoint.com/_api/Web/GetFolderByServerRelativePath(decodedurl='/Shared%20Documents/Salesforce/sub%20Salesforce')",
"type": "SP.Folder"
},
"Name": "sub Salesforce"
}
]
}
}
if i am using deserialization as i cannot use __metadata variable i am always getting null,could you help me in getting the value of __metadata in apex
could some one help me in parsing the below json,
{
"d": {
"results": [
{
"__metadata": {
"id": "https://testasugo.sharepoint.com/_api/Web/GetFolderByServerRelativePath(decodedurl='/Shared Documents/Salesforce/Salesforcetwo')",
"uri": "https://testasugo.sharepoint.com/_api/Web/GetFolderByServerRelativePath(decodedurl='/Shared%20Documents/Salesforce/Salesforcetwo')",
"type": "SP.Folder"
},
"Name": "Salesforcetwo"
},
{
"__metadata": {
"id": "https://testasugo.sharepoint.com/_api/Web/GetFolderByServerRelativePath(decodedurl='/Shared Documents/Salesforce/sub Salesforce')",
"uri": "https://testasugo.sharepoint.com/_api/Web/GetFolderByServerRelativePath(decodedurl='/Shared%20Documents/Salesforce/sub%20Salesforce')",
"type": "SP.Folder"
},
"Name": "sub Salesforce"
}
]
}
}
if i am using deserialization as i cannot use __metadata variable i am always getting null,could you help me in getting the value of __metadata in apex
Try parsing with Map instead.
Regards,
MKR