External APIGet API Request

Get API Request Logs

This endpoint retrieves logs of API requests with various filtering options.

Endpoint

GET https://client-api.wappcloud.com/api/v1/external/api-requests

Authentication

  • x-api-key (required) - Your API key for authentication
  • Authorization (required) - Bearer token for authentication. Format: Bearer <your_token>

Query Parameters

ParameterTypeRequiredDescription
pageintegerNoPage number for pagination (default: 1)
limitintegerNoNumber of items per page (default: 10)
sentbooleanNoFilter by sent status
readbooleanNoFilter by read status
template_namestringNoFilter by template name
message_uidstringNoFilter by specific message UID
start_datedateNoFilter by start date (YYYY-MM-DD)
end_datedateNoFilter by end date (YYYY-MM-DD)
contact_numberstringNoFilter by contact number
contact_namestringNoFilter by contact name

Request Headers

GET /external/api-requests?page=3&limit=10&sent=true&read=false&template_name=location&message_uid=6a7d01ee8de8488a&start_date=2025-07-02&end_date=2025-07-02
x-api-key: your_api_key_here

Get API Request Logs

Response

Success Response (200 OK)

{
  "code": 200,
  "message": "API logs fetched successfully",
  "success": true,
  "data": {
    "totalMessages": 10,
    "sentCount": 0,
    "deliveredCount": 0,
    "readCount": 0,
    "failedCount": 0,
    "logs": [
      {
        "template_name": "hello_world",
        "message_uid": "583e40b0c04347c7",
        "contact_number": "+919xxxxxxxxxx",
        "contact_name": "John Doe",
        "sent": null,
        "delivered": null,
        "read": null,
        "failed": null,
        "createdAt": "2025-07-02T04:25:49.001Z"
      }
      // ... more log entries
    ],
    "paginationDetails": {
      "totalCount": 64,
      "totalPages": 7,
      "currentPage": 1,
      "nextPage": 2,
      "prevPage": null
    }
  }
}

Response Fields

Data Object

  • totalMessages (integer): Total number of messages matching the filter criteria
  • sentCount (integer): Number of sent messages
  • deliveredCount (integer): Number of delivered messages
  • readCount (integer): Number of read messages
  • failedCount (integer): Number of failed messages
  • logs (array): Array of log objects
  • paginationDetails (object): Pagination information

Log Object

  • template_name (string): Name of the template used
  • message_uid (string): Unique identifier for the message
  • contact_number (string/null): Contact number of the recipient
  • contact_name (string/null): Contact name of the recipient
  • sent (boolean/null): Whether the message was sent
  • delivered (boolean/null): Whether the message was delivered
  • read (boolean/null): Whether the message was read
  • failed (boolean/null): Whether the message failed
  • createdAt (string): ISO 8601 timestamp of creation

Pagination Details

  • totalCount (integer): Total number of items
  • totalPages (integer): Total number of pages
  • currentPage (integer): Current page number
  • nextPage (integer/null): Next page number, null if on last page
  • prevPage (integer/null): Previous page number, null if on first page

Error Responses

401 Unauthorized

Missing or invalid API key

400 Bad Request

Invalid query parameters

Notes

  • All date filters are inclusive
  • Boolean filters (sent, read) should be passed as true or false
  • The response is paginated with a default of 10 items per page