Monitor API Usage with Request Logs

The Payiano's Request Log is an invaluable resource for businesses, serving as a window into the interactions between clients and the API. It offers a detailed account of how the API is used, including insights into user behaviors, request patterns, and system performance. This endpoint is instrumental in identifying trends, pinpointing areas for improvement, and ensuring optimal functionality of the API.

Overall, the Request Log is a critical tool for maintaining the health and efficiency of the API. It empowers businesses to make data-driven decisions, improve integration capabilities, and ultimately contributes significantly to the success and growth of the organization.

By analyzing the data collected through this endpoint, businesses can gain a deeper understanding of their user base, including how and when the API is accessed most frequently. This information is key to optimizing the user experience, enhancing system performance, and ensuring the APIs stability and scalability. Furthermore, the log plays a crucial role in security and compliance, offering the ability to track and analyze access patterns, detect anomalies, and respond promptly to potential threats or breaches.

GET/request_logs
Sandbox: https://api.payiano.dev/v1/request_logs
Live: https://api.payiano.com/v1/request_logs
Security
  • Authorization header with access token is required to access this endpoint: Bearer ACCESS-TOKEN
  • Your access token should be associated to this permission request_logs_view
Request
Request body schema:
application/json
Query parameters:
page
Type: integer|null
Default: 1

The page number to be retrieved, for the list of request logs. So, a combination of page=1 and per_page=25 returns the first 25 request logs. A combination of page=2 and per_page=25 returns the next 25 request logs.

per_page
Type: integer|null
Default: 25
Possible values: [1 ... 200]

The maximum number of request logs to return in the response.

Response
200
Response schema:
application/json
Response body:
total_pages
Type: integer

The total number of pages that are available for the Request Logs search criteria.

current_page
Type: integer

The current pagination page.

per_page
Type: integer

The amount of Request Logs items return per page.

total_items
Type: integer

The total number of Request Logs that match the search criteria.

items
Type: array_of_objects

The list of Request Logs that match the search criteria.

id
Type: ulid
Length: 26

The unique ID assigned to each Request Log which is generated by our system using the ULID format. Each ID is precisely 26 characters long, ensuring a unique and consistent identifier for every Request Log. This ULID is automatically created by our system and is used to uniquely identify and track each Request Log in our database.

path
Type: string

The API endpoint that was accessed. This information is vital for understanding which parts of your API are most used or may need optimization or additional security measures.

method
Type: string

The HTTP method used. Knowing the method helps in analyzing the nature of the requests (e.g., data retrieval vs. data submission) and optimizing API endpoints accordingly.

origin
Type: string|null

The domain from which the request originated. It's important for identifying the source of the traffic, understanding user behavior, and detecting potentially malicious sources.

response_time
Type: integer

The Milliseconds taken to process the request. Critical for assessing the performance of your API and identifying slow or problematic endpoints.

client_agent
Type: string|null

Information about the client's software (browser, OS). This helps in understanding the environments in which your API is used and ensuring compatibility across different systems.

client_ip
Type: string|null

The IP address of the client making the request. Useful for geo-locating users, analyzing traffic patterns, and detecting suspicious activities.

request_query
Type: mixed|null

Query parameters often dictate how the data should be filtered or customized when returned by the API. For instance, parameters might specify which fields to return, limit the number of records, or apply specific filters. It helps in understanding these user preferences and requirements.

request_body
Type: mixed|null

The data sent by the client in the request. Essential for debugging issues, understanding user behavior, and optimizing the user experience.

request_headers
Type: mixed|null

Headers sent by the client. These can provide context about the request, such as authentication tokens, preferred languages, and client capabilities.

response_code
Type: integer

The HTTP status code returned (e.g., 200 OK, 422 Unprocessable Entity). Important for monitoring the health of your API and identifying errors or issues that need attention.

response_body
Type: mixed|null

The data sent back to the client in response to their request. Crucial for ensuring the correct operation of your API and understanding how responses are handled by clients.

response_headers
Type: mixed|null

Headers sent back in the response. They can include metadata about the response, such as content type and cache controls, which are important for client-side processing and optimization.

requested_at
Type: datetime

Date of when the request was made. This is essential for monitoring API usage over time, identifying peak usage periods, and planning for scaling. This attribute can be formatted as an ISO 8601 string or a UNIX timestamp in milliseconds, depending on the preferred datetime format specified in the request header (e.g., 2024-08-04T14:22:01Z or 1722572118554). By default, the format is UNIX timestamp in milliseconds.

created_at
Type: datetime

The created datetime of the request log. This attribute can be formatted as an ISO 8601 string or a UNIX timestamp in milliseconds, depending on the preferred datetime format specified in the request header (e.g., 2024-08-04T14:22:01Z or 1722572118554). By default, the format is UNIX timestamp in milliseconds.

updated_at
Type: datetime

The updated datetime of the request log. This attribute can be formatted as an ISO 8601 string or a UNIX timestamp in milliseconds, depending on the preferred datetime format specified in the request header (e.g., 2024-08-04T14:22:01Z or 1722572118554). By default, the format is UNIX timestamp in milliseconds.

Response sample:
1
{
2 "per_page": 25, 3 "total_pages": 1, 4 "total_items": 1, 5 "current_page": 1, 6
"items": [
7
{
8 "id": "01hqh45s7826hfwdze8dp1z21f", 9 "path": "v1/customers", 10 "method": "POST", 11 "origin": "my.payiano.com", 12 "response_time": 1, 13 "client_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36", 14 "client_ip": "199.36.158.100", 15
"request_query": {
16
"includes": [
17 "customer.billding_address" 18 ] 19 }, 20
"request_body": {
21 "name": "Yara Kamal", 22 "email": "yara@pyngy.com", 23 "reference_id": "db64355a-8e8d-31e8-a782-2dce8057fe61" 24 }, 25
"request_headers": {
26
"host": [
27 "api.payiano.com" 28 ], 29
"accept": [
30 "application/json" 31 ], 32 "authorization": "Bearer eyJpdiI***********ZRcGQUG4", 33
"user-agent": [
34 "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" 35 ] 36 }, 37 "response_code": 422, 38
"response_body": {
39 "message": "The reference id has already been taken.", 40
"errors": {
41
"reference_id": [
42 "The reference id has already been taken." 43 ] 44 } 45 }, 46
"response_headers": {
47
"Cache-Control": [
48 "no-cache, private" 49 ], 50
"Date": [
51 "Mon, 29 Jan 2024 07:22:21 GMT" 52 ], 53
"Content-Type": [
54 "application/json" 55 ] 56 }, 57 "requested_at": "1722572118554", 58 "created_at": "1722572118554", 59 "updated_at": "1722572118554" 60 } 61 ] 62}