# cURL example to get metered license consumptioncurl -v "http://<base url>/v2.0/viewer/consumption"\
-X GET \
-H "Accept: application/json"\
-H "Authorization: Bearer <jwt token>"
{"credit":487848,"quantity":6061570985.37938}
Response
The response structure contains metered license consumption information:
Name
Type
Comment
Credit
decimal
Amount of used credits.
Quantity
decimal
Amount of MBs processed.
SDK examples
Our API is completely independent of your operating system, database system or development language. You can use any language and platform that supports HTTP to interact with our API. However, manually writing client code can be difficult, error-prone and time-consuming. Therefore, we have provided and support API SDKs in many development languages in order to make it easier to integrate with us.
// For complete examples and data files, please go to https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-dotnet-samplesstringMyClientSecret="";// Get ClientId and ClientSecret from https://dashboard.groupdocs.cloudstringMyClientId="";// Get ClientId and ClientSecret from https://dashboard.groupdocs.cloudvarconfiguration=newConfiguration(MyClientId,MyClientSecret);// Create necessary API instancesvarapiInstance=newLicenseApi(configuration);varresponse=apiInstance.GetConsumptionCredit();Console.WriteLine($"Credits: {response.Credit}");Console.WriteLine($"Quantity: {response.Quantity}");
// For complete examples and data files, please go to https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-java-samples
StringMyClientSecret="";// Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
StringMyClientId="";// Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
Configurationconfiguration=newConfiguration(MyClientId,MyClientSecret);// Create API instance
LicenseApiapiInstance=newLicenseApi(configuration);ConsumptionResultresponse=apiInstance.getConsumptionCredit();System.out.println("Credit: "+response.getCredit());System.out.println("Quantity: "+response.getQuantity());
// For complete examples and data files, please go to https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-php-samples
useGroupDocs\Viewer\Model;useGroupDocs\Viewer\Model\Requests;$ClientId="";// Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
$ClientSecret="";// Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
$configuration=newGroupDocs\Viewer\Configuration();$configuration->setAppSid($ClientId);$configuration->setAppKey($ClientSecret);$apiInstance=newGroupDocs\Viewer\LicenseApi($configuration);// Prepare request
$filePath=dirname(realpath(__DIR__)).'\Resources\WordProcessing\four-pages.docx';$request=newRequests\ConvertDocumentDirectRequest("pdf",$filePath);// Get consumption
$result=$apiInstance->getConsumptionCredit();// Done
echo"Credit: ".$result->getCredit();
// For complete examples and data files, please go to https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-node-samples
global.viewer_cloud=require("groupdocs-viewer-cloud");global.clientId="XXXX-XXXX-XXXX-XXXX";// Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
global.clientSecret="XXXXXXXXXXXXXXXX";// Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
global.licenseApi=viewer_cloud.LicenseApi.fromKeys(clientId,clientSecret);letresponse=awaitlicenseApi.getConsumptionCredit();console.log("GetLicenseConsumption: Credit = "+response.credit);
# For complete examples and data files, please go to https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-python-samplesimportgroupdocs_viewer_cloudclient_id="XXXX-XXXX-XXXX-XXXX"# Get ClientId and ClientSecret from https://dashboard.groupdocs.cloudclient_secret="XXXXXXXXXXXXXXXX"# Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud# Create necessary API instancesapiInstance=groupdocs_viewer_cloud.LicenseApi.from_keys(Common.client_id,Common.client_secret)# Get consumptionresult=apiInstance.get_consumption_credit()print("Credit: "+result.credit)
# For complete examples and data files, please go to https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-ruby-samplesrequire'groupdocs_viewer_cloud'$client_id="XXXX-XXXX-XXXX-XXXX"# Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud$client_secret="XXXXXXXXXXXXXXXX"# Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud# Create necessary API instancesapiInstance=GroupDocsViewerCloud::LicenseApi.from_keys($client_id,$client_secret)# Get consumptionresult=apiInstance.get_consumption_credit()puts("Credit: "+result.credit)
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.