Skip to main content

Billing Logs API

This document highlights the Billing Logs details.

API Description

Objective

The Billing Logs API provides daily usage logs of all API calls made against each App ID for the previous day. These logs can be retrieved and stored for cross verification with the Results API, Case Management, and monthly billing records.

InputOutput
The date for which the usage logs are requested A URL to download the CSV file containing the previous day's API usage logs

API URL

https://billing-dashboard.hyperverge.co/v1/logs/module/daily

API Endpoint

logs/module/daily

Overview

The API is RESTful and uses standard HTTP verbs and status codes. The responses are in JSON format and you should upload all images and files as form-data through a POST request.

Authentication

You need a unique pair of application ID ( appId ) and application key (appKey) from HyperVerge to verify your identity for accessing the API.

ParameterMandatory or OptionalDescriptionAllowed Values
content-type MandatoryThis parameter defines the media type for the request payloadapplication/json
appId MandatoryThe application identifier shared by HyperVerge. You can find the details in the dashboard's credentials tab.This should be a unique value.
appKey MandatoryThe application key shared by HyperVerge. You can find the details in the dashboard's credentials tab.This should be a unique value.

Input

The following table provides the complete information on the input parameter for the API:

ParameterDescriptionMandatory or OptionalAllowed ValuesDefault Value
dateThe requested date for the logs, which must be a past date and accessible only after 10 AM the following dayMandatoryAllowed format:
YYYY-MM-DD
Not Applicable

Request

The following code snippet demonstrates a standard curl request for the API:

curl --location --request POST 'https://billing-dashboard.hyperverge.co/v1/logs/module/daily' \
--header 'Content-Type: application/json' \
--header 'appId: <Enter_the_HyperVerge_appId>' \
--header 'appKey: <Enter_the_HyperVerge_appKey>' \
--data '{
"date": "<Enter_the_date_in_YYYY-MM-DD_format>"
}'

Success Response

The following is a success response from the API:

{
"status": "success",
"data": {
"url": "s3Url"
}
}

Success Response Details

The following table highlights the details of the success response from the API:

ParameterTypeDescription
statusstringThe status of the request
dataobjectThe object containing the response data
urlstringThe URL pointing to the log file(CSV) stored in S3, which is valid for 15 minutes

Structure of the CSV File

The CSV file provided by the S3 link has the following structure:

Field NameDescription
requestidA unique identifier for tracking and reference, which is assigned to each request
appidAn App ID which was used to make the request
reference_idAn identifier provided in the API request to track and associate it with another API or workflow
transaction_idA unique identifier associated with the specific transaction related to the request
statuscodeThe HTTP status code returned by the API, indicating the success or failure of the request
originalurlThe API endpoint URL where the request was sent
event_timestampThe exact date and time (in UTC) when the request was initiated

Failure Response

The following code snippet displays a failure response from the API:

{
"statusCode": 404,
"status": "error",
"message": "File not found"
}

Error Responses

The following are the error responses from the API:

{
"status": 400,
"message": {
"message": "Validation Failed",
"error": {
"date": "'date' is required"
}
}
}

Failure and Error Response Details

A failure or error response from the module contains a failure status, with a relevant status code and error message. The following table lists all the error responses:


Status CodeError MessageError Description
400Validation FailedThe request is missing a mandatory field — date is required
401Missing/Invalid credentialsThe request is either missing the mandatory appId and appKey combination or has invalid values
404File not foundThe requested log file could not be found
422Invalid dateThe provided date contains an invalid value or is a date in the future
500Internal Server ErrorPlease check the request headers or contact the HyperVerge team for resolution.
Was this helpful?
Ask AIBeta
Hi! How can I help?
Ask me anything about HyperVerge products, APIs, and SDKs.
Try asking: