Usage a business


Usage a business

This endpoint serves as a valuable tool for generating data required to create visual charts and graphs for reporting purposes.


Request and Headers

curl --location --request GET 'https://core.getfaceage.com/api/v1/business/usage/{business_id}?from=2024-01-01&to=2024-01-30' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer your_secret_key'

Query Parameters

from :

Specifies the start date of the desired date range. Data records with timestamps greater than or equal to this date will be included in the filtered results.

Type: string

to :

Specifies the end date of the desired date range. Data records with timestamps less than or equal to this date will be included in the filtered results.

Type: string


Response

Upon receiving a valid GET request, the API responds with a JSON-formatted payload containing the structured data suitable for chart creation. The response may include date and count of usage to render the chart accurately.

{success} Response 200

{
    "status": true,
    "data": {
        "used": [
            {
                "date": "2024-01-01",
                "count": 1
            },
            {
                "date": "2024-01-02",
                "count": 1
            },
            {
                "date": "2024-01-03",
                "count": 11
            },
            {
                "date": "2024-01-04",
                "count": 0
            },
            {
                "date": "2024-01-05",
                "count": 1
            },
            {
                "date": "2024-01-06",
                "count": 0
            },
            {
                "date": "2024-01-07",
                "count": 7
            },
            {
                "date": "2024-01-08",
                "count": 8
            },
            {
                "date": "2024-01-09",
                "count": 40
            },
            {
                "date": "2024-01-10",
                "count": 37
            },
            {
                "date": "2024-01-11",
                "count": 17
            },
            {
                "date": "2024-01-12",
                "count": 31
            },
            {
                "date": "2024-01-13",
                "count": 44
            },
            {
                "date": "2024-01-14",
                "count": 61
            },
            {
                "date": "2024-01-15",
                "count": 32
            },
            {
                "date": "2024-01-16",
                "count": 7
            },
            {
                "date": "2024-01-17",
                "count": 2
            },
            {
                "date": "2024-01-18",
                "count": 2
            },
            {
                "date": "2024-01-19",
                "count": 2
            },
            {
                "date": "2024-01-20",
                "count": 21
            },
            {
                "date": "2024-01-21",
                "count": 3
            },
            {
                "date": "2024-01-22",
                "count": 28
            },
            {
                "date": "2024-01-23",
                "count": 22
            },
            {
                "date": "2024-01-24",
                "count": 15
            },
            {
                "date": "2024-01-25",
                "count": 0
            },
            {
                "date": "2024-01-26",
                "count": 3
            },
            {
                "date": "2024-01-27",
                "count": 19
            },
            {
                "date": "2024-01-28",
                "count": 33
            },
            {
                "date": "2024-01-29",
                "count": 31
            },
            {
                "date": "2024-01-30",
                "count": 30
            }
        ]
    }
}


{warning} Response 422 : Invalid Business

{
    "status": false,
    "message": "business id is not valid"
}


{warning} Response 401 : Unauthorized

{
    "message": "Unauthenticated."
}