Back to Collection Items
Use ChilkatAx-win32.pkg
Procedure Test
Handle hoHttp
Boolean iSuccess
Variant vSbResponseBody
Handle hoSbResponseBody
Handle hoJResp
Integer iRespStatusCode
Integer iMax
Integer iRemaining
Integer iAnalyticsExternalDataSizeMBMax
Integer iAnalyticsExternalDataSizeMBRemaining
Integer iConcurrentAsyncGetReportInstancesMax
Integer iConcurrentAsyncGetReportInstancesRemaining
Integer iConcurrentEinsteinDataInsightsStoryCreationMax
Integer iConcurrentEinsteinDataInsightsStoryCreationRemaining
Integer iConcurrentEinsteinDiscoveryStoryCreationMax
Integer iConcurrentEinsteinDiscoveryStoryCreationRemaining
Integer iConcurrentSyncReportRunsMax
Integer iConcurrentSyncReportRunsRemaining
Integer iDailyAnalyticsDataflowJobExecutionsMax
Integer iDailyAnalyticsDataflowJobExecutionsRemaining
Integer iDailyAnalyticsUploadedFilesSizeMBMax
Integer iDailyAnalyticsUploadedFilesSizeMBRemaining
Integer iDailyApiRequestsMax
Integer iDailyApiRequestsRemaining
Integer iDailyAsyncApexExecutionsMax
Integer iDailyAsyncApexExecutionsRemaining
Integer iDailyAsyncApexTestsMax
Integer iDailyAsyncApexTestsRemaining
Integer iDailyBulkApiBatchesMax
Integer iDailyBulkApiBatchesRemaining
Integer iDailyBulkV2QueryFileStorageMBMax
Integer iDailyBulkV2QueryFileStorageMBRemaining
Integer iDailyBulkV2QueryJobsMax
Integer iDailyBulkV2QueryJobsRemaining
Integer iDailyDeliveredPlatformEventsMax
Integer iDailyDeliveredPlatformEventsRemaining
Integer iDailyDurableGenericStreamingApiEventsMax
Integer iDailyDurableGenericStreamingApiEventsRemaining
Integer iDailyDurableStreamingApiEventsMax
Integer iDailyDurableStreamingApiEventsRemaining
Integer iDailyEinsteinDataInsightsStoryCreationMax
Integer iDailyEinsteinDataInsightsStoryCreationRemaining
Integer iDailyEinsteinDiscoveryOptimizationJobRunsMax
Integer iDailyEinsteinDiscoveryOptimizationJobRunsRemaining
Integer iDailyEinsteinDiscoveryPredictAPICallsMax
Integer iDailyEinsteinDiscoveryPredictAPICallsRemaining
Integer iDailyEinsteinDiscoveryPredictionsByCDCMax
Integer iDailyEinsteinDiscoveryPredictionsByCDCRemaining
Integer iDailyEinsteinDiscoveryStoryCreationMax
Integer iDailyEinsteinDiscoveryStoryCreationRemaining
Integer iDailyFunctionsApiCallLimitMax
Integer iDailyFunctionsApiCallLimitRemaining
Integer iDailyGenericStreamingApiEventsMax
Integer iDailyGenericStreamingApiEventsRemaining
Integer iDailyScratchOrgsMax
Integer iDailyScratchOrgsRemaining
Integer iDailyStandardVolumePlatformEventsMax
Integer iDailyStandardVolumePlatformEventsRemaining
Integer iDailyStreamingApiEventsMax
Integer iDailyStreamingApiEventsRemaining
Integer iDailyWorkflowEmailsMax
Integer iDailyWorkflowEmailsRemaining
Integer iDataStorageMBMax
Integer iDataStorageMBRemaining
Integer iDurableStreamingApiConcurrentClientsMax
Integer iDurableStreamingApiConcurrentClientsRemaining
Integer iFileStorageMBMax
Integer iFileStorageMBRemaining
Integer iHourlyAsyncReportRunsMax
Integer iHourlyAsyncReportRunsRemaining
Integer iHourlyDashboardRefreshesMax
Integer iHourlyDashboardRefreshesRemaining
Integer iHourlyDashboardResultsMax
Integer iHourlyDashboardResultsRemaining
Integer iHourlyDashboardStatusesMax
Integer iHourlyDashboardStatusesRemaining
Integer iHourlyLongTermIdMappingMax
Integer iHourlyLongTermIdMappingRemaining
Integer iHourlyManagedContentPublicRequestsMax
Integer iHourlyManagedContentPublicRequestsRemaining
Integer iHourlyODataCalloutMax
Integer iHourlyODataCalloutRemaining
Integer iHourlyPublishedPlatformEventsMax
Integer iHourlyPublishedPlatformEventsRemaining
Integer iHourlyPublishedStandardVolumePlatformEventsMax
Integer iHourlyPublishedStandardVolumePlatformEventsRemaining
Integer iHourlyShortTermIdMappingMax
Integer iHourlyShortTermIdMappingRemaining
Integer iHourlySyncReportRunsMax
Integer iHourlySyncReportRunsRemaining
Integer iHourlyTimeBasedWorkflowMax
Integer iHourlyTimeBasedWorkflowRemaining
Integer iMassEmailMax
Integer iMassEmailRemaining
Integer iMonthlyEinsteinDiscoveryStoryCreationMax
Integer iMonthlyEinsteinDiscoveryStoryCreationRemaining
Integer iPackage2VersionCreatesMax
Integer iPackage2VersionCreatesRemaining
Integer iPackage2VersionCreatesWithoutValidationMax
Integer iPackage2VersionCreatesWithoutValidationRemaining
Integer iPermissionSetsMax
Integer iPermissionSetsRemaining
Integer iCreateCustomMax
Integer iCreateCustomRemaining
Integer iPrivateConnectOutboundCalloutHourlyLimitMBMax
Integer iPrivateConnectOutboundCalloutHourlyLimitMBRemaining
Integer iPublishCallbackUsageInApexMax
Integer iPublishCallbackUsageInApexRemaining
Integer iSingleEmailMax
Integer iSingleEmailRemaining
Integer iStreamingApiConcurrentClientsMax
Integer iStreamingApiConcurrentClientsRemaining
String sTemp1
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
Get Create (RefClass(cComChilkatHttp)) To hoHttp
If (Not(IsComObjectCreated(hoHttp))) Begin
Send CreateComObject of hoHttp
End
// Adds the "Authorization: Bearer <access_token>" header.
Set ComAuthToken Of hoHttp To "<access_token>"
Get Create (RefClass(cComChilkatStringBuilder)) To hoSbResponseBody
If (Not(IsComObjectCreated(hoSbResponseBody))) Begin
Send CreateComObject of hoSbResponseBody
End
Get pvComObject of hoSbResponseBody to vSbResponseBody
Get ComQuickGetSb Of hoHttp "https://domain.com/services/data/v{{version}}/limits" vSbResponseBody To iSuccess
If (iSuccess = False) Begin
Get ComLastErrorText Of hoHttp To sTemp1
Showln sTemp1
Procedure_Return
End
Get Create (RefClass(cComChilkatJsonObject)) To hoJResp
If (Not(IsComObjectCreated(hoJResp))) Begin
Send CreateComObject of hoJResp
End
Get pvComObject of hoSbResponseBody to vSbResponseBody
Get ComLoadSb Of hoJResp vSbResponseBody To iSuccess
Set ComEmitCompact Of hoJResp To False
Showln "Response Body:"
Get ComEmit Of hoJResp To sTemp1
Showln sTemp1
Get ComLastStatus Of hoHttp To iRespStatusCode
Showln "Response Status Code = " iRespStatusCode
If (iRespStatusCode >= 400) Begin
Showln "Response Header:"
Get ComLastHeader Of hoHttp To sTemp1
Showln sTemp1
Showln "Failed."
Procedure_Return
End
// Sample JSON response:
// (Sample code for parsing the JSON response is shown below)
// {
// "ActiveScratchOrgs": {
// "Max": 3,
// "Remaining": 3
// },
// "AnalyticsExternalDataSizeMB": {
// "Max": 40960,
// "Remaining": 40960
// },
// "ConcurrentAsyncGetReportInstances": {
// "Max": 200,
// "Remaining": 200
// },
// "ConcurrentEinsteinDataInsightsStoryCreation": {
// "Max": 5,
// "Remaining": 5
// },
// "ConcurrentEinsteinDiscoveryStoryCreation": {
// "Max": 2,
// "Remaining": 2
// },
// "ConcurrentSyncReportRuns": {
// "Max": 20,
// "Remaining": 20
// },
// "DailyAnalyticsDataflowJobExecutions": {
// "Max": 60,
// "Remaining": 60
// },
// "DailyAnalyticsUploadedFilesSizeMB": {
// "Max": 51200,
// "Remaining": 51200
// },
// "DailyApiRequests": {
// "Max": 15000,
// "Remaining": 14999
// },
// "DailyAsyncApexExecutions": {
// "Max": 250000,
// "Remaining": 250000
// },
// "DailyAsyncApexTests": {
// "Max": 540,
// "Remaining": 540
// },
// "DailyBulkApiBatches": {
// "Max": 15000,
// "Remaining": 15000
// },
// "DailyBulkV2QueryFileStorageMB": {
// "Max": 976562,
// "Remaining": 976562
// },
// "DailyBulkV2QueryJobs": {
// "Max": 10000,
// "Remaining": 10000
// },
// "DailyDeliveredPlatformEvents": {
// "Max": 10000,
// "Remaining": 10000
// },
// "DailyDurableGenericStreamingApiEvents": {
// "Max": 10000,
// "Remaining": 10000
// },
// "DailyDurableStreamingApiEvents": {
// "Max": 10000,
// "Remaining": 10000
// },
// "DailyEinsteinDataInsightsStoryCreation": {
// "Max": 1000,
// "Remaining": 1000
// },
// "DailyEinsteinDiscoveryOptimizationJobRuns": {
// "Max": 25,
// "Remaining": 25
// },
// "DailyEinsteinDiscoveryPredictAPICalls": {
// "Max": 50000,
// "Remaining": 50000
// },
// "DailyEinsteinDiscoveryPredictionsByCDC": {
// "Max": 500000,
// "Remaining": 500000
// },
// "DailyEinsteinDiscoveryStoryCreation": {
// "Max": 100,
// "Remaining": 100
// },
// "DailyFunctionsApiCallLimit": {
// "Max": 50000,
// "Remaining": 50000
// },
// "DailyGenericStreamingApiEvents": {
// "Max": 10000,
// "Remaining": 10000
// },
// "DailyScratchOrgs": {
// "Max": 6,
// "Remaining": 6
// },
// "DailyStandardVolumePlatformEvents": {
// "Max": 10000,
// "Remaining": 10000
// },
// "DailyStreamingApiEvents": {
// "Max": 10000,
// "Remaining": 10000
// },
// "DailyWorkflowEmails": {
// "Max": 405,
// "Remaining": 405
// },
// "DataStorageMB": {
// "Max": 5,
// "Remaining": 5
// },
// "DurableStreamingApiConcurrentClients": {
// "Max": 20,
// "Remaining": 20
// },
// "FileStorageMB": {
// "Max": 20,
// "Remaining": 20
// },
// "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
// },
// "HourlyManagedContentPublicRequests": {
// "Max": 50000,
// "Remaining": 50000
// },
// "HourlyODataCallout": {
// "Max": 1000,
// "Remaining": 1000
// },
// "HourlyPublishedPlatformEvents": {
// "Max": 50000,
// "Remaining": 50000
// },
// "HourlyPublishedStandardVolumePlatformEvents": {
// "Max": 1000,
// "Remaining": 1000
// },
// "HourlyShortTermIdMapping": {
// "Max": 100000,
// "Remaining": 100000
// },
// "HourlySyncReportRuns": {
// "Max": 500,
// "Remaining": 500
// },
// "HourlyTimeBasedWorkflow": {
// "Max": 50,
// "Remaining": 50
// },
// "MassEmail": {
// "Max": 10,
// "Remaining": 10
// },
// "MonthlyEinsteinDiscoveryStoryCreation": {
// "Max": 500,
// "Remaining": 500
// },
// "Package2VersionCreates": {
// "Max": 6,
// "Remaining": 6
// },
// "Package2VersionCreatesWithoutValidation": {
// "Max": 500,
// "Remaining": 500
// },
// "PermissionSets": {
// "Max": 1500,
// "Remaining": 1498,
// "CreateCustom": {
// "Max": 1000,
// "Remaining": 998
// }
// },
// "PrivateConnectOutboundCalloutHourlyLimitMB": {
// "Max": 0,
// "Remaining": 0
// },
// "PublishCallbackUsageInApex": {
// "Max": 5242880,
// "Remaining": 5242880
// },
// "SingleEmail": {
// "Max": 15,
// "Remaining": 15
// },
// "StreamingApiConcurrentClients": {
// "Max": 20,
// "Remaining": 20
// }
// }
// Sample code for parsing the JSON response...
// Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code
Get ComIntOf Of hoJResp "ActiveScratchOrgs.Max" To iMax
Get ComIntOf Of hoJResp "ActiveScratchOrgs.Remaining" To iRemaining
Get ComIntOf Of hoJResp "AnalyticsExternalDataSizeMB.Max" To iAnalyticsExternalDataSizeMBMax
Get ComIntOf Of hoJResp "AnalyticsExternalDataSizeMB.Remaining" To iAnalyticsExternalDataSizeMBRemaining
Get ComIntOf Of hoJResp "ConcurrentAsyncGetReportInstances.Max" To iConcurrentAsyncGetReportInstancesMax
Get ComIntOf Of hoJResp "ConcurrentAsyncGetReportInstances.Remaining" To iConcurrentAsyncGetReportInstancesRemaining
Get ComIntOf Of hoJResp "ConcurrentEinsteinDataInsightsStoryCreation.Max" To iConcurrentEinsteinDataInsightsStoryCreationMax
Get ComIntOf Of hoJResp "ConcurrentEinsteinDataInsightsStoryCreation.Remaining" To iConcurrentEinsteinDataInsightsStoryCreationRemaining
Get ComIntOf Of hoJResp "ConcurrentEinsteinDiscoveryStoryCreation.Max" To iConcurrentEinsteinDiscoveryStoryCreationMax
Get ComIntOf Of hoJResp "ConcurrentEinsteinDiscoveryStoryCreation.Remaining" To iConcurrentEinsteinDiscoveryStoryCreationRemaining
Get ComIntOf Of hoJResp "ConcurrentSyncReportRuns.Max" To iConcurrentSyncReportRunsMax
Get ComIntOf Of hoJResp "ConcurrentSyncReportRuns.Remaining" To iConcurrentSyncReportRunsRemaining
Get ComIntOf Of hoJResp "DailyAnalyticsDataflowJobExecutions.Max" To iDailyAnalyticsDataflowJobExecutionsMax
Get ComIntOf Of hoJResp "DailyAnalyticsDataflowJobExecutions.Remaining" To iDailyAnalyticsDataflowJobExecutionsRemaining
Get ComIntOf Of hoJResp "DailyAnalyticsUploadedFilesSizeMB.Max" To iDailyAnalyticsUploadedFilesSizeMBMax
Get ComIntOf Of hoJResp "DailyAnalyticsUploadedFilesSizeMB.Remaining" To iDailyAnalyticsUploadedFilesSizeMBRemaining
Get ComIntOf Of hoJResp "DailyApiRequests.Max" To iDailyApiRequestsMax
Get ComIntOf Of hoJResp "DailyApiRequests.Remaining" To iDailyApiRequestsRemaining
Get ComIntOf Of hoJResp "DailyAsyncApexExecutions.Max" To iDailyAsyncApexExecutionsMax
Get ComIntOf Of hoJResp "DailyAsyncApexExecutions.Remaining" To iDailyAsyncApexExecutionsRemaining
Get ComIntOf Of hoJResp "DailyAsyncApexTests.Max" To iDailyAsyncApexTestsMax
Get ComIntOf Of hoJResp "DailyAsyncApexTests.Remaining" To iDailyAsyncApexTestsRemaining
Get ComIntOf Of hoJResp "DailyBulkApiBatches.Max" To iDailyBulkApiBatchesMax
Get ComIntOf Of hoJResp "DailyBulkApiBatches.Remaining" To iDailyBulkApiBatchesRemaining
Get ComIntOf Of hoJResp "DailyBulkV2QueryFileStorageMB.Max" To iDailyBulkV2QueryFileStorageMBMax
Get ComIntOf Of hoJResp "DailyBulkV2QueryFileStorageMB.Remaining" To iDailyBulkV2QueryFileStorageMBRemaining
Get ComIntOf Of hoJResp "DailyBulkV2QueryJobs.Max" To iDailyBulkV2QueryJobsMax
Get ComIntOf Of hoJResp "DailyBulkV2QueryJobs.Remaining" To iDailyBulkV2QueryJobsRemaining
Get ComIntOf Of hoJResp "DailyDeliveredPlatformEvents.Max" To iDailyDeliveredPlatformEventsMax
Get ComIntOf Of hoJResp "DailyDeliveredPlatformEvents.Remaining" To iDailyDeliveredPlatformEventsRemaining
Get ComIntOf Of hoJResp "DailyDurableGenericStreamingApiEvents.Max" To iDailyDurableGenericStreamingApiEventsMax
Get ComIntOf Of hoJResp "DailyDurableGenericStreamingApiEvents.Remaining" To iDailyDurableGenericStreamingApiEventsRemaining
Get ComIntOf Of hoJResp "DailyDurableStreamingApiEvents.Max" To iDailyDurableStreamingApiEventsMax
Get ComIntOf Of hoJResp "DailyDurableStreamingApiEvents.Remaining" To iDailyDurableStreamingApiEventsRemaining
Get ComIntOf Of hoJResp "DailyEinsteinDataInsightsStoryCreation.Max" To iDailyEinsteinDataInsightsStoryCreationMax
Get ComIntOf Of hoJResp "DailyEinsteinDataInsightsStoryCreation.Remaining" To iDailyEinsteinDataInsightsStoryCreationRemaining
Get ComIntOf Of hoJResp "DailyEinsteinDiscoveryOptimizationJobRuns.Max" To iDailyEinsteinDiscoveryOptimizationJobRunsMax
Get ComIntOf Of hoJResp "DailyEinsteinDiscoveryOptimizationJobRuns.Remaining" To iDailyEinsteinDiscoveryOptimizationJobRunsRemaining
Get ComIntOf Of hoJResp "DailyEinsteinDiscoveryPredictAPICalls.Max" To iDailyEinsteinDiscoveryPredictAPICallsMax
Get ComIntOf Of hoJResp "DailyEinsteinDiscoveryPredictAPICalls.Remaining" To iDailyEinsteinDiscoveryPredictAPICallsRemaining
Get ComIntOf Of hoJResp "DailyEinsteinDiscoveryPredictionsByCDC.Max" To iDailyEinsteinDiscoveryPredictionsByCDCMax
Get ComIntOf Of hoJResp "DailyEinsteinDiscoveryPredictionsByCDC.Remaining" To iDailyEinsteinDiscoveryPredictionsByCDCRemaining
Get ComIntOf Of hoJResp "DailyEinsteinDiscoveryStoryCreation.Max" To iDailyEinsteinDiscoveryStoryCreationMax
Get ComIntOf Of hoJResp "DailyEinsteinDiscoveryStoryCreation.Remaining" To iDailyEinsteinDiscoveryStoryCreationRemaining
Get ComIntOf Of hoJResp "DailyFunctionsApiCallLimit.Max" To iDailyFunctionsApiCallLimitMax
Get ComIntOf Of hoJResp "DailyFunctionsApiCallLimit.Remaining" To iDailyFunctionsApiCallLimitRemaining
Get ComIntOf Of hoJResp "DailyGenericStreamingApiEvents.Max" To iDailyGenericStreamingApiEventsMax
Get ComIntOf Of hoJResp "DailyGenericStreamingApiEvents.Remaining" To iDailyGenericStreamingApiEventsRemaining
Get ComIntOf Of hoJResp "DailyScratchOrgs.Max" To iDailyScratchOrgsMax
Get ComIntOf Of hoJResp "DailyScratchOrgs.Remaining" To iDailyScratchOrgsRemaining
Get ComIntOf Of hoJResp "DailyStandardVolumePlatformEvents.Max" To iDailyStandardVolumePlatformEventsMax
Get ComIntOf Of hoJResp "DailyStandardVolumePlatformEvents.Remaining" To iDailyStandardVolumePlatformEventsRemaining
Get ComIntOf Of hoJResp "DailyStreamingApiEvents.Max" To iDailyStreamingApiEventsMax
Get ComIntOf Of hoJResp "DailyStreamingApiEvents.Remaining" To iDailyStreamingApiEventsRemaining
Get ComIntOf Of hoJResp "DailyWorkflowEmails.Max" To iDailyWorkflowEmailsMax
Get ComIntOf Of hoJResp "DailyWorkflowEmails.Remaining" To iDailyWorkflowEmailsRemaining
Get ComIntOf Of hoJResp "DataStorageMB.Max" To iDataStorageMBMax
Get ComIntOf Of hoJResp "DataStorageMB.Remaining" To iDataStorageMBRemaining
Get ComIntOf Of hoJResp "DurableStreamingApiConcurrentClients.Max" To iDurableStreamingApiConcurrentClientsMax
Get ComIntOf Of hoJResp "DurableStreamingApiConcurrentClients.Remaining" To iDurableStreamingApiConcurrentClientsRemaining
Get ComIntOf Of hoJResp "FileStorageMB.Max" To iFileStorageMBMax
Get ComIntOf Of hoJResp "FileStorageMB.Remaining" To iFileStorageMBRemaining
Get ComIntOf Of hoJResp "HourlyAsyncReportRuns.Max" To iHourlyAsyncReportRunsMax
Get ComIntOf Of hoJResp "HourlyAsyncReportRuns.Remaining" To iHourlyAsyncReportRunsRemaining
Get ComIntOf Of hoJResp "HourlyDashboardRefreshes.Max" To iHourlyDashboardRefreshesMax
Get ComIntOf Of hoJResp "HourlyDashboardRefreshes.Remaining" To iHourlyDashboardRefreshesRemaining
Get ComIntOf Of hoJResp "HourlyDashboardResults.Max" To iHourlyDashboardResultsMax
Get ComIntOf Of hoJResp "HourlyDashboardResults.Remaining" To iHourlyDashboardResultsRemaining
Get ComIntOf Of hoJResp "HourlyDashboardStatuses.Max" To iHourlyDashboardStatusesMax
Get ComIntOf Of hoJResp "HourlyDashboardStatuses.Remaining" To iHourlyDashboardStatusesRemaining
Get ComIntOf Of hoJResp "HourlyLongTermIdMapping.Max" To iHourlyLongTermIdMappingMax
Get ComIntOf Of hoJResp "HourlyLongTermIdMapping.Remaining" To iHourlyLongTermIdMappingRemaining
Get ComIntOf Of hoJResp "HourlyManagedContentPublicRequests.Max" To iHourlyManagedContentPublicRequestsMax
Get ComIntOf Of hoJResp "HourlyManagedContentPublicRequests.Remaining" To iHourlyManagedContentPublicRequestsRemaining
Get ComIntOf Of hoJResp "HourlyODataCallout.Max" To iHourlyODataCalloutMax
Get ComIntOf Of hoJResp "HourlyODataCallout.Remaining" To iHourlyODataCalloutRemaining
Get ComIntOf Of hoJResp "HourlyPublishedPlatformEvents.Max" To iHourlyPublishedPlatformEventsMax
Get ComIntOf Of hoJResp "HourlyPublishedPlatformEvents.Remaining" To iHourlyPublishedPlatformEventsRemaining
Get ComIntOf Of hoJResp "HourlyPublishedStandardVolumePlatformEvents.Max" To iHourlyPublishedStandardVolumePlatformEventsMax
Get ComIntOf Of hoJResp "HourlyPublishedStandardVolumePlatformEvents.Remaining" To iHourlyPublishedStandardVolumePlatformEventsRemaining
Get ComIntOf Of hoJResp "HourlyShortTermIdMapping.Max" To iHourlyShortTermIdMappingMax
Get ComIntOf Of hoJResp "HourlyShortTermIdMapping.Remaining" To iHourlyShortTermIdMappingRemaining
Get ComIntOf Of hoJResp "HourlySyncReportRuns.Max" To iHourlySyncReportRunsMax
Get ComIntOf Of hoJResp "HourlySyncReportRuns.Remaining" To iHourlySyncReportRunsRemaining
Get ComIntOf Of hoJResp "HourlyTimeBasedWorkflow.Max" To iHourlyTimeBasedWorkflowMax
Get ComIntOf Of hoJResp "HourlyTimeBasedWorkflow.Remaining" To iHourlyTimeBasedWorkflowRemaining
Get ComIntOf Of hoJResp "MassEmail.Max" To iMassEmailMax
Get ComIntOf Of hoJResp "MassEmail.Remaining" To iMassEmailRemaining
Get ComIntOf Of hoJResp "MonthlyEinsteinDiscoveryStoryCreation.Max" To iMonthlyEinsteinDiscoveryStoryCreationMax
Get ComIntOf Of hoJResp "MonthlyEinsteinDiscoveryStoryCreation.Remaining" To iMonthlyEinsteinDiscoveryStoryCreationRemaining
Get ComIntOf Of hoJResp "Package2VersionCreates.Max" To iPackage2VersionCreatesMax
Get ComIntOf Of hoJResp "Package2VersionCreates.Remaining" To iPackage2VersionCreatesRemaining
Get ComIntOf Of hoJResp "Package2VersionCreatesWithoutValidation.Max" To iPackage2VersionCreatesWithoutValidationMax
Get ComIntOf Of hoJResp "Package2VersionCreatesWithoutValidation.Remaining" To iPackage2VersionCreatesWithoutValidationRemaining
Get ComIntOf Of hoJResp "PermissionSets.Max" To iPermissionSetsMax
Get ComIntOf Of hoJResp "PermissionSets.Remaining" To iPermissionSetsRemaining
Get ComIntOf Of hoJResp "PermissionSets.CreateCustom.Max" To iCreateCustomMax
Get ComIntOf Of hoJResp "PermissionSets.CreateCustom.Remaining" To iCreateCustomRemaining
Get ComIntOf Of hoJResp "PrivateConnectOutboundCalloutHourlyLimitMB.Max" To iPrivateConnectOutboundCalloutHourlyLimitMBMax
Get ComIntOf Of hoJResp "PrivateConnectOutboundCalloutHourlyLimitMB.Remaining" To iPrivateConnectOutboundCalloutHourlyLimitMBRemaining
Get ComIntOf Of hoJResp "PublishCallbackUsageInApex.Max" To iPublishCallbackUsageInApexMax
Get ComIntOf Of hoJResp "PublishCallbackUsageInApex.Remaining" To iPublishCallbackUsageInApexRemaining
Get ComIntOf Of hoJResp "SingleEmail.Max" To iSingleEmailMax
Get ComIntOf Of hoJResp "SingleEmail.Remaining" To iSingleEmailRemaining
Get ComIntOf Of hoJResp "StreamingApiConcurrentClients.Max" To iStreamingApiConcurrentClientsMax
Get ComIntOf Of hoJResp "StreamingApiConcurrentClients.Remaining" To iStreamingApiConcurrentClientsRemaining
End_Procedure
Curl Command
curl -X GET
-H "Authorization: Bearer <access_token>"
https://domain.com/services/data/v{{version}}/limits
Postman Collection Item JSON
{
"name": "Limits",
"event": [
{
"listen": "test",
"script": {
"exec": [
"// Visualizer that renders a Chart.js graph with the Salesforce API limits consumption",
"const template = `<script src=\"https://cdn.jsdelivr.net/npm/chart.js@3.5.1/dist/chart.min.js\"></script>",
"<canvas id=\"myChart\" width=\"400\" height=\"800\"></canvas>",
"<script>",
"pm.getData((err, chartData) => {",
" const getTooltipFooter = (tooltipItems) => {",
" const index = tooltipItems[0].dataIndex;",
" return 'Consumed '+ chartData.consumed[index] +' out of '+ chartData.max[index];",
" };",
"",
" const ctx = document.getElementById('myChart').getContext('2d');",
" const myChart = new Chart(ctx, {",
" type: 'bar',",
" data: {",
" labels: chartData.labels,",
" datasets: [",
" {",
" label: '% Consumed',",
" data: chartData.consumedPercent,",
" backgroundColor: 'rgba(255, 99, 132, 1)',",
" borderColor: 'rgba(255, 99, 132, 1)',",
" borderWidth: 1",
" }",
" ]",
" },",
" options: {",
" indexAxis: 'y',",
" responsive: true,",
" scales: {",
" x: {",
" beginAtZero: true,",
" ticks: {",
" callback: (value, index, values) => value + '%'",
" },",
" max: 100",
" }",
" },",
" interaction: {",
" intersect: false,",
" mode: 'y'",
" },",
" plugins: {",
" tooltip: {",
" callbacks: {",
" footer: getTooltipFooter,",
" label: (tooltipItems) => tooltipItems.raw + '%'",
" }",
" },",
" title: {",
" display: true,",
" text: 'API Limits Consumption'",
" },",
" legend: {",
" display: false",
" }",
" }",
" }",
" });",
"});",
"</script>`;",
"",
"// Format API response into chart data",
"const responseJson = pm.response.json();",
"const chartData = {",
" labels: [],",
" consumed: [],",
" consumedPercent: [],",
" max: []",
"};",
"Object.keys(responseJson).forEach((limitName) => {",
" const { Max, Remaining } = responseJson[limitName];",
" const consumed = Max - Remaining;",
" let percent = 0;",
" if (Max !== 0) {",
" percent = (consumed / Max) * 100;",
" percent = percent",
" .toString()",
" .match(/^-?\\d+(?:\\.\\d{0,2})?/)[0];",
" }",
" chartData.labels.push(limitName);",
" chartData.consumed.push(consumed);",
" chartData.consumedPercent.push(percent);",
" chartData.max.push(Max);",
"});",
"// Render vizualizer",
"pm.visualizer.set(template, chartData);"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "GET",
"header": [
],
"url": {
"raw": "{{_endpoint}}/services/data/v{{version}}/limits",
"host": [
"{{_endpoint}}"
],
"path": [
"services",
"data",
"v{{version}}",
"limits"
]
},
"description": "Lists information about limits in your org. For each limit, this resource returns the maximum allocation and the remaining allocation based on usage. This resource is available in REST API version 29.0 and later for API users with the View Setup and Configuration permission"
},
"response": [
{
"name": "Limits",
"originalRequest": {
"method": "GET",
"header": [
],
"url": {
"raw": "{{_endpoint}}/services/data/v{{version}}/limits",
"host": [
"{{_endpoint}}"
],
"path": [
"services",
"data",
"v{{version}}",
"limits"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Date",
"value": "Tue, 26 Sep 2023 13:19:11 GMT"
},
{
"key": "Strict-Transport-Security",
"value": "max-age=63072000; includeSubDomains"
},
{
"key": "X-Content-Type-Options",
"value": "nosniff"
},
{
"key": "X-XSS-Protection",
"value": "1; mode=block"
},
{
"key": "X-Robots-Tag",
"value": "none"
},
{
"key": "Cache-Control",
"value": "no-cache,must-revalidate,max-age=0,no-store,private"
},
{
"key": "Sforce-Limit-Info",
"value": "api-usage=1/15000"
},
{
"key": "Content-Type",
"value": "application/json;charset=UTF-8"
},
{
"key": "Vary",
"value": "Accept-Encoding"
},
{
"key": "Content-Encoding",
"value": "gzip"
},
{
"key": "Transfer-Encoding",
"value": "chunked"
}
],
"cookie": [
],
"body": "{\n \"ActiveScratchOrgs\": {\n \"Max\": 3,\n \"Remaining\": 3\n },\n \"AnalyticsExternalDataSizeMB\": {\n \"Max\": 40960,\n \"Remaining\": 40960\n },\n \"ConcurrentAsyncGetReportInstances\": {\n \"Max\": 200,\n \"Remaining\": 200\n },\n \"ConcurrentEinsteinDataInsightsStoryCreation\": {\n \"Max\": 5,\n \"Remaining\": 5\n },\n \"ConcurrentEinsteinDiscoveryStoryCreation\": {\n \"Max\": 2,\n \"Remaining\": 2\n },\n \"ConcurrentSyncReportRuns\": {\n \"Max\": 20,\n \"Remaining\": 20\n },\n \"DailyAnalyticsDataflowJobExecutions\": {\n \"Max\": 60,\n \"Remaining\": 60\n },\n \"DailyAnalyticsUploadedFilesSizeMB\": {\n \"Max\": 51200,\n \"Remaining\": 51200\n },\n \"DailyApiRequests\": {\n \"Max\": 15000,\n \"Remaining\": 14999\n },\n \"DailyAsyncApexExecutions\": {\n \"Max\": 250000,\n \"Remaining\": 250000\n },\n \"DailyAsyncApexTests\": {\n \"Max\": 540,\n \"Remaining\": 540\n },\n \"DailyBulkApiBatches\": {\n \"Max\": 15000,\n \"Remaining\": 15000\n },\n \"DailyBulkV2QueryFileStorageMB\": {\n \"Max\": 976562,\n \"Remaining\": 976562\n },\n \"DailyBulkV2QueryJobs\": {\n \"Max\": 10000,\n \"Remaining\": 10000\n },\n \"DailyDeliveredPlatformEvents\": {\n \"Max\": 10000,\n \"Remaining\": 10000\n },\n \"DailyDurableGenericStreamingApiEvents\": {\n \"Max\": 10000,\n \"Remaining\": 10000\n },\n \"DailyDurableStreamingApiEvents\": {\n \"Max\": 10000,\n \"Remaining\": 10000\n },\n \"DailyEinsteinDataInsightsStoryCreation\": {\n \"Max\": 1000,\n \"Remaining\": 1000\n },\n \"DailyEinsteinDiscoveryOptimizationJobRuns\": {\n \"Max\": 25,\n \"Remaining\": 25\n },\n \"DailyEinsteinDiscoveryPredictAPICalls\": {\n \"Max\": 50000,\n \"Remaining\": 50000\n },\n \"DailyEinsteinDiscoveryPredictionsByCDC\": {\n \"Max\": 500000,\n \"Remaining\": 500000\n },\n \"DailyEinsteinDiscoveryStoryCreation\": {\n \"Max\": 100,\n \"Remaining\": 100\n },\n \"DailyFunctionsApiCallLimit\": {\n \"Max\": 50000,\n \"Remaining\": 50000\n },\n \"DailyGenericStreamingApiEvents\": {\n \"Max\": 10000,\n \"Remaining\": 10000\n },\n \"DailyScratchOrgs\": {\n \"Max\": 6,\n \"Remaining\": 6\n },\n \"DailyStandardVolumePlatformEvents\": {\n \"Max\": 10000,\n \"Remaining\": 10000\n },\n \"DailyStreamingApiEvents\": {\n \"Max\": 10000,\n \"Remaining\": 10000\n },\n \"DailyWorkflowEmails\": {\n \"Max\": 405,\n \"Remaining\": 405\n },\n \"DataStorageMB\": {\n \"Max\": 5,\n \"Remaining\": 5\n },\n \"DurableStreamingApiConcurrentClients\": {\n \"Max\": 20,\n \"Remaining\": 20\n },\n \"FileStorageMB\": {\n \"Max\": 20,\n \"Remaining\": 20\n },\n \"HourlyAsyncReportRuns\": {\n \"Max\": 1200,\n \"Remaining\": 1200\n },\n \"HourlyDashboardRefreshes\": {\n \"Max\": 200,\n \"Remaining\": 200\n },\n \"HourlyDashboardResults\": {\n \"Max\": 5000,\n \"Remaining\": 5000\n },\n \"HourlyDashboardStatuses\": {\n \"Max\": 999999999,\n \"Remaining\": 999999999\n },\n \"HourlyLongTermIdMapping\": {\n \"Max\": 100000,\n \"Remaining\": 100000\n },\n \"HourlyManagedContentPublicRequests\": {\n \"Max\": 50000,\n \"Remaining\": 50000\n },\n \"HourlyODataCallout\": {\n \"Max\": 1000,\n \"Remaining\": 1000\n },\n \"HourlyPublishedPlatformEvents\": {\n \"Max\": 50000,\n \"Remaining\": 50000\n },\n \"HourlyPublishedStandardVolumePlatformEvents\": {\n \"Max\": 1000,\n \"Remaining\": 1000\n },\n \"HourlyShortTermIdMapping\": {\n \"Max\": 100000,\n \"Remaining\": 100000\n },\n \"HourlySyncReportRuns\": {\n \"Max\": 500,\n \"Remaining\": 500\n },\n \"HourlyTimeBasedWorkflow\": {\n \"Max\": 50,\n \"Remaining\": 50\n },\n \"MassEmail\": {\n \"Max\": 10,\n \"Remaining\": 10\n },\n \"MonthlyEinsteinDiscoveryStoryCreation\": {\n \"Max\": 500,\n \"Remaining\": 500\n },\n \"Package2VersionCreates\": {\n \"Max\": 6,\n \"Remaining\": 6\n },\n \"Package2VersionCreatesWithoutValidation\": {\n \"Max\": 500,\n \"Remaining\": 500\n },\n \"PermissionSets\": {\n \"Max\": 1500,\n \"Remaining\": 1498,\n \"CreateCustom\": {\n \"Max\": 1000,\n \"Remaining\": 998\n }\n },\n \"PrivateConnectOutboundCalloutHourlyLimitMB\": {\n \"Max\": 0,\n \"Remaining\": 0\n },\n \"PublishCallbackUsageInApex\": {\n \"Max\": 5242880,\n \"Remaining\": 5242880\n },\n \"SingleEmail\": {\n \"Max\": 15,\n \"Remaining\": 15\n },\n \"StreamingApiConcurrentClients\": {\n \"Max\": 20,\n \"Remaining\": 20\n }\n}"
}
]
}