You need to sign in to do that
Don't have an account?
raz r
How to parse the below json
I want to parse the below json and return the Value from DailyApiRequests Max into a Integer.
"ConcurrentSyncReportRuns":{"Max":20,"Remaining":20},
"DailyAnalyticsDataflowJobExecutions":{"Max":40,"Remaining":40},
"DailyApiRequests":{"Max":16124600,"Remaining":16123983}
Please helep me .Urgent!!!!
"ConcurrentSyncReportRuns":{"Max":20,"Remaining":20},
"DailyAnalyticsDataflowJobExecutions":{"Max":40,"Remaining":40},
"DailyApiRequests":{"Max":16124600,"Remaining":16123983}
Please helep me .Urgent!!!!
Your correct json format is like this:
{
"title": {
"ConcurrentSyncReportRuns": {
"Max": 20,
"Remaining": 20
},
"DailyAnalyticsDataflowJobExecutions": {
"Max": 40,
"Remaining": 40
},
"DailyApiRequests": {
"Max": 16124600,
"Remaining": 16123983
}
}
}
-----------------------
And your corresponding class is:
Plz let me know if it works
Mark your ans to help others
Thanks
Niraj
Public void jsondata() {
String strJSON = ' your above json string ';
fromJSON objJSON = (fromJSON) JSON.deserialize(strJSON, fromJSON.class);
}
}
Hope it will work ...
I want to get the DailyApiRequests Max value into a Integer.
Note: One small update needed in this above Class: fromJSON. Make all Inner class public and then execute this below code from developer console. You will get your DailyApiRequests Max value into a Integer.
Please let me know if it works for you.
Cheers !!
Mark the ans so that it can help others as well.
Thanks
Niraj
I am getting attempt to derefernce for my json , could you please help meout for the same.
here is my json
'{"AnalyticsExternalDataSizeMB":{"Max":40960,"Remaining":40960},"ConcurrentAsyncGetReportInstances":{"Max":200,"Remaining":200},"ConcurrentSyncReportRuns":{"Max":20,"Remaining":20},"DailyAnalyticsDataflowJobExecutions":{"Max":60,"Remaining":60},"DailyAnalyticsUploadedFilesSizeMB":{"Max":51200,"Remaining":51200},"DailyApiRequests":{"Max":492840000,"Remaining":492839704,"Ant Migration Tool":{"Max":0,"Remaining":0},"BFM Mulesoft":{"Max":0,"Remaining":0},"CPQ Integration User Connected App":{"Max":0,"Remaining":0},"Chatter Desktop":{"Max":0,"Remaining":0},"Chatter Mobile for BlackBerry":{"Max":0,"Remaining":0},"Dataloader Bulk":{"Max":0,"Remaining":0},"Dataloader Partner":{"Max":0,"Remaining":0},"Easy2Find_DEV":{"Max":0,"Remaining":0},"Easy2Find_PREPROD":{"Max":0,"Remaining":0},"Easy2Find_PROD":{"Max":0,"Remaining":0},"Elastic ELK":{"Max":0,"Remaining":0},"Force.com IDE":{"Max":0,"Remaining":0},"FourAcres":{"Max":0,"Remaining":0},"Inside.Unilever":{"Max":0,"Remaining":0},"LiveMessage for Salesforce":{"Max":0,"Remaining":0},"LiveText for Salesforce (QA)":{"Max":0,"Remaining":0},"MapAnything":{"Max":0,"Remaining":0},"MapAnything Territory Management":{"Max":0,"Remaining":0},"MuleSoft Vendor BPM":{"Max":0,"Remaining":0},"News Centre":{"Max":0,"Remaining":0},"News Centre QA":{"Max":0,"Remaining":0},"Prod_Heroku_Mulesoft":{"Max":0,"Remaining":0},"Prod_Heroku_Postman":{"Max":0,"Remaining":0},"Prod_Heroku_Wave":{"Max":0,"Remaining":0},"SMS Magic Interact":{"Max":0,"Remaining":0},"Salesforce Chatter":{"Max":0,"Remaining":0},"Salesforce Files":{"Max":0,"Remaining":0},"Salesforce Mobile Dashboards":{"Max":0,"Remaining":0},"Salesforce Touch":{"Max":0,"Remaining":0},"Salesforce for Android":{"Max":0,"Remaining":0},"Salesforce for Outlook":{"Max":0,"Remaining":0},"Salesforce for iOS":{"Max":0,"Remaining":0},"SalesforceA":{"Max":0,"Remaining":0},"SalesforceA for Android":{"Max":0,"Remaining":0},"SalesforceA for iOS":{"Max":0,"Remaining":0},"Sharepoint Online":{"Max":0,"Remaining":0},"Showpad App":{"Max":0,"Remaining":0},"Showpad Salesforce Integration":{"Max":0,"Remaining":0},"Teamsites.Unilever":{"Max":0,"Remaining":0},"Wings 2.0":{"Max":0,"Remaining":0},"Workbench":{"Max":0,"Remaining":0},"Your News":{"Max":0,"Remaining":0},"getAbstract":{"Max":0,"Remaining":0}},"DailyAsyncApexExecutions":{"Max":30425000,"Remaining":30424998},"DailyBulkApiRequests":{"Max":10000,"Remaining":10000,"Ant Migration Tool":{"Max":0,"Remaining":0},"BFM Mulesoft":{"Max":0,"Remaining":0},"CPQ Integration User Connected App":{"Max":0,"Remaining":0},"Chatter Desktop":{"Max":0,"Remaining":0},"Chatter Mobile for BlackBerry":{"Max":0,"Remaining":0},"Dataloader Bulk":{"Max":0,"Remaining":0},"Dataloader Partner":{"Max":0,"Remaining":0},"Easy2Find_DEV":{"Max":0,"Remaining":0},"Easy2Find_PREPROD":{"Max":0,"Remaining":0},"Easy2Find_PROD":{"Max":0,"Remaining":0},"Elastic ELK":{"Max":0,"Remaining":0},"Force.com IDE":{"Max":0,"Remaining":0},"FourAcres":{"Max":0,"Remaining":0},"Inside.Unilever":{"Max":0,"Remaining":0},"LiveMessage for Salesforce":{"Max":0,"Remaining":0},"LiveText for Salesforce (QA)":{"Max":0,"Remaining":0},"MapAnything":{"Max":0,"Remaining":0},"MapAnything Territory Management":{"Max":0,"Remaining":0},"MuleSoft Vendor BPM":{"Max":0,"Remaining":0},"News Centre":{"Max":0,"Remaining":0},"News Centre QA":{"Max":0,"Remaining":0},"Prod_Heroku_Mulesoft":{"Max":0,"Remaining":0},"Prod_Heroku_Postman":{"Max":0,"Remaining":0},"Prod_Heroku_Wave":{"Max":0,"Remaining":0},"SMS Magic Interact":{"Max":0,"Remaining":0},"Salesforce Chatter":{"Max":0,"Remaining":0},"Salesforce Files":{"Max":0,"Remaining":0},"Salesforce Mobile Dashboards":{"Max":0,"Remaining":0},"Salesforce Touch":{"Max":0,"Remaining":0},"Salesforce for Android":{"Max":0,"Remaining":0},"Salesforce for Outlook":{"Max":0,"Remaining":0},"Salesforce for iOS":{"Max":0,"Remaining":0},"SalesforceA":{"Max":0,"Remaining":0},"SalesforceA for Android":{"Max":0,"Remaining":0},"SalesforceA for iOS":{"Max":0,"Remaining":0},"Sharepoint Online":{"Max":0,"Remaining":0},"Showpad App":{"Max":0,"Remaining":0},"Showpad Salesforce Integration":{"Max":0,"Remaining":0},"Teamsites.Unilever":{"Max":0,"Remaining":0},"Wings 2.0":{"Max":0,"Remaining":0},"Workbench":{"Max":0,"Remaining":0},"Your News":{"Max":0,"Remaining":0},"getAbstract":{"Max":0,"Remaining":0}},"DailyDurableGenericStreamingApiEvents":{"Max":1000000,"Remaining":1000000},"DailyDurableStreamingApiEvents":{"Max":1000000,"Remaining":1000000},"DailyGenericStreamingApiEvents":{"Max":10000,"Remaining":10000,"Ant Migration Tool":{"Max":0,"Remaining":0},"BFM Mulesoft":{"Max":0,"Remaining":0},"CPQ Integration User Connected App":{"Max":0,"Remaining":0},"Chatter Desktop":{"Max":0,"Remaining":0},"Chatter Mobile for BlackBerry":{"Max":0,"Remaining":0},"Dataloader Bulk":{"Max":0,"Remaining":0},"Dataloader Partner":{"Max":0,"Remaining":0},"Easy2Find_DEV":{"Max":0,"Remaining":0},"Easy2Find_PREPROD":{"Max":0,"Remaining":0},"Easy2Find_PROD":{"Max":0,"Remaining":0},"Elastic ELK":{"Max":0,"Remaining":0},"Force.com IDE":{"Max":0,"Remaining":0},"FourAcres":{"Max":0,"Remaining":0},"Inside.Unilever":{"Max":0,"Remaining":0},"LiveMessage for Salesforce":{"Max":0,"Remaining":0},"LiveText for Salesforce (QA)":{"Max":0,"Remaining":0},"MapAnything":{"Max":0,"Remaining":0},"MapAnything Territory Management":{"Max":0,"Remaining":0},"MuleSoft Vendor BPM":{"Max":0,"Remaining":0},"News Centre":{"Max":0,"Remaining":0},"News Centre QA":{"Max":0,"Remaining":0},"Prod_Heroku_Mulesoft":{"Max":0,"Remaining":0},"Prod_Heroku_Postman":{"Max":0,"Remaining":0},"Prod_Heroku_Wave":{"Max":0,"Remaining":0},"SMS Magic Interact":{"Max":0,"Remaining":0},"Salesforce Chatter":{"Max":0,"Remaining":0},"Salesforce Files":{"Max":0,"Remaining":0},"Salesforce Mobile Dashboards":{"Max":0,"Remaining":0},"Salesforce Touch":{"Max":0,"Remaining":0},"Salesforce for Android":{"Max":0,"Remaining":0},"Salesforce for Outlook":{"Max":0,"Remaining":0},"Salesforce for iOS":{"Max":0,"Remaining":0},"SalesforceA":{"Max":0,"Remaining":0},"SalesforceA for Android":{"Max":0,"Remaining":0},"SalesforceA for iOS":{"Max":0,"Remaining":0},"Sharepoint Online":{"Max":0,"Remaining":0},"Showpad App":{"Max":0,"Remaining":0},"Showpad Salesforce Integration":{"Max":0,"Remaining":0},"Teamsites.Unilever":{"Max":0,"Remaining":0},"Wings 2.0":{"Max":0,"Remaining":0},"Workbench":{"Max":0,"Remaining":0},"Your News":{"Max":0,"Remaining":0},"getAbstract":{"Max":0,"Remaining":0}},"DailyStandardVolumePlatformEvents":{"Max":50000,"Remaining":50000},"DailyStreamingApiEvents":{"Max":1000000,"Remaining":999983,"Ant Migration Tool":{"Max":0,"Remaining":0},"BFM Mulesoft":{"Max":0,"Remaining":0},"CPQ Integration User Connected App":{"Max":0,"Remaining":0},"Chatter Desktop":{"Max":0,"Remaining":0},"Chatter Mobile for BlackBerry":{"Max":0,"Remaining":0},"Dataloader Bulk":{"Max":0,"Remaining":0},"Dataloader Partner":{"Max":0,"Remaining":0},"Easy2Find_DEV":{"Max":0,"Remaining":0},"Easy2Find_PREPROD":{"Max":0,"Remaining":0},"Easy2Find_PROD":{"Max":0,"Remaining":0},"Elastic ELK":{"Max":0,"Remaining":0},"Force.com IDE":{"Max":0,"Remaining":0},"FourAcres":{"Max":0,"Remaining":0},"Inside.Unilever":{"Max":0,"Remaining":0},"LiveMessage for Salesforce":{"Max":0,"Remaining":0},"LiveText for Salesforce (QA)":{"Max":0,"Remaining":0},"MapAnything":{"Max":0,"Remaining":0},"MapAnything Territory Management":{"Max":0,"Remaining":0},"MuleSoft Vendor BPM":{"Max":0,"Remaining":0},"News Centre":{"Max":0,"Remaining":0},"News Centre QA":{"Max":0,"Remaining":0},"Prod_Heroku_Mulesoft":{"Max":0,"Remaining":0},"Prod_Heroku_Postman":{"Max":0,"Remaining":0},"Prod_Heroku_Wave":{"Max":0,"Remaining":0},"SMS Magic Interact":{"Max":0,"Remaining":0},"Salesforce Chatter":{"Max":0,"Remaining":0},"Salesforce Files":{"Max":0,"Remaining":0},"Salesforce Mobile Dashboards":{"Max":0,"Remaining":0},"Salesforce Touch":{"Max":0,"Remaining":0},"Salesforce for Android":{"Max":0,"Remaining":0},"Salesforce for Outlook":{"Max":0,"Remaining":0},"Salesforce for iOS":{"Max":0,"Remaining":0},"SalesforceA":{"Max":0,"Remaining":0},"SalesforceA for Android":{"Max":0,"Remaining":0},"SalesforceA for iOS":{"Max":0,"Remaining":0},"Sharepoint Online":{"Max":0,"Remaining":0},"Showpad App":{"Max":0,"Remaining":0},"Showpad Salesforce Integration":{"Max":0,"Remaining":0},"Teamsites.Unilever":{"Max":0,"Remaining":0},"Wings 2.0":{"Max":0,"Remaining":0},"Workbench":{"Max":0,"Remaining":0},"Your News":{"Max":0,"Remaining":0},"getAbstract":{"Max":0,"Remaining":0}},"DailyWorkflowEmails":{"Max":2000000,"Remaining":2000000},"DataStorageMB":{"Max":200,"Remaining":-19},"DurableStreamingApiConcurrentClients":{"Max":2000,"Remaining":2000},"FileStorageMB":{"Max":200,"Remaining":194},"HourlyAsyncReportRuns":{"Max":1200,"Remaining":1200},"HourlyDashboardRefreshes":{"Max":200,"Remaining":200},"HourlyDashboardResults":{"Max":5000,"Remaining":5000},"HourlyDashboardStatuses":{"Max":999999999,"Remaining":999999999},"HourlyLongTermIdMapping":{"Max":100000,"Remaining":100000},"HourlyODataCallout":{"Max":100000,"Remaining":100000},"HourlyShortTermIdMapping":{"Max":100000,"Remaining":100000},"HourlySyncReportRuns":{"Max":500,"Remaining":500},"HourlyTimeBasedWorkflow":{"Max":50,"Remaining":50},"MassEmail":{"Max":5000,"Remaining":5000},"MonthlyPlatformEvents":{"Max":1500000,"Remaining":1500000},"Package2VersionCreates":{"Max":6,"Remaining":6},"PermissionSets":{"Max":1500,"Remaining":1115,"CreateCustom":{"Max":1000,"Remaining":651}},"SingleEmail":{"Max":6000,"Remaining":6000},"StreamingApiConcurrentClients":{"Max":2000,"Remaining":2000}}'