Business API Stats
List logs
List logs for everyone or a contact for a business API user. Optional query parameters: limit, contact, job_id and state.
HTTP Request
GET https://api.moya.app/v1/stats/logs
Parameters
Name | Type | Required | Description |
---|---|---|---|
limit | String | Optional | Limit the number of logs to show |
contact | String | Optional | Specify the jid of a contact to show |
state | String | Optional | Select the state of the logs to show |
job_id | String | Optional | Select the state of the logs to show |
Example requests
Example 1: Retrieve logs with limit 10
curl --location --request GET 'https://api.moya.app/v1/stats/logs?limit=10' \
--header 'Authorization: Bearer YourSecretToken'
Example 1: Successful Response (Status : 200)
[
{
"created": "2022-03-28T09:58:09.118000",
"contact": "27111111111@binu.m.in-app.io",
"state": "delivery_failed",
"job_id": "00000000-0000-0000-0000-000000000001"
}
]
Example 2: Retrieve logs with limit 10
curl --location --request GET 'https://api.moya.app/v1/stats/logs?limit=10' \
--header 'Authorization: Bearer YourSecretToken'
Example 2: Successful Response (Status : 200)
[
{
"created": "2022-03-28T09:58:09.118000",
"contact": "27111111111@binu.m.in-app.io",
"state": "delivery_failed",
"job_id": "00000000-0000-0000-0000-000000000001"
}
]
Example 2: Retrieve logs with contact and state filter
curl --location --request GET 'https://api.moya.app/v1/stats/logs?contact=2711111111@binu.m.in-app.io&state=delivery_failed' \
--header 'Authorization: Bearer YourSecretToken'
Example 2: Successful Response (Status : 200)
[
{
"created": "2022-03-28T09:58:09.118000",
"contact": "27111111111@binu.m.in-app.io",
"state": "delivery_failed",
"job_id": "00000000-0000-0000-0000-000000000001"
}
]
Example 3: Retrieve logs (No Result)
curl --location --request GET 'https://api.moya.app/v1/stats/logs?limit=10' \
--header 'Authorization: Bearer YourSecretToken'
Example 3: No Content Response (Status : 204)
STATUS: 204
List jobs
List jobs over a time period.
Example request
curl --location --request GET 'https://api.moya.app/v1/stats/jobs?start_date=2022-01-15&end_date=2022-06-25' \
--header 'Authorization: Bearer YourSecretToken'
HTTP Request
GET https://api.moya.app/v1/stats/jobs?start_date=2022-01-15&end_date=2022-06-16
Parameters
Name | Type | Required | Description |
---|---|---|---|
start_date | String | Yes | The start date of the jobs to be retrieved. |
end_date | String | Yes | The end date of the jobs to be retrieved. |
Response
Every successful request is responded to with a json (200 OK
) or an empty HTTP response (204 No Content
).
Example requests
Example 1: Retrieve jobs with date range
curl --location --request GET 'https://api.moya.app/v1/stats/jobs?start_date=2022-01-15&end_date=2022-06-25' \
--header 'Authorization: Bearer YourSecretToken'
Example 1: Successful Response
[
{
"job_id": "00000000-0000-0000-0000-000000000001",
"state": "delivery_failed",
"payload_type": "",
"count": 1
}
]
Example 2: Retrieve jobs with date range (No Result)
curl --location --request GET 'https://api.moya.app/v1/stats/jobs?start_date=2012-01-15&end_date=2012-06-25' \
--header 'Authorization: Bearer YourSecretToken'
Example 2: No Content Response (Status : 204)
STATUS: 204