REST API
Events and Transactions via REST API
The DockRay REST API lets you send errors, exceptions, and HTTP transaction data directly to the DockRay platform from any application, service, or device.
This solution is designed primarily for technologies that do not yet have a dedicated DockRay library, module, or plugin.
Error and Exception Reporting
The error endpoint lets you send events containing the information needed to diagnose issues in your application.
An event can include:
- the error or exception type and message,
- the stack trace,
- the environment and application version,
- SDK, runtime, and operating system information,
- HTTP request context,
- optional user data.
HTTP Transaction Monitoring
A separate endpoint lets you report completed HTTP transactions, including the transaction name, method, URL, event timestamp, response status code, and environment information.
This data can be used to analyze traffic, request history, and the distribution of HTTP responses within the monitored project.
Any Technology
The REST API does not require a specific programming language or framework. All you need is the ability to make HTTP requests and send data in JSON format.
This makes it possible to integrate DockRay with custom backends, microservices, devices, scripts, and less common technologies.
Authentication
Each event is assigned to a project using its token, while the request is authenticated with the project's private key passed in the Authorization header.
The private key should be stored exclusively on the server and must never be exposed in public application code.
Data Format
The endpoints accept JSON data in a format compatible with the DockRay event model. The payload can be sent directly or compressed using gzip.
Installation
To integrate with DockRay, you need the project token and private key available in the DockRay dashboard.
The project token is part of the endpoint URL, while the private key must be passed as a Bearer Token in the Authorization header.
Error Reporting
Send a POST request to the following endpoint:
https://dockray.io/api/v1/PROJECT_TOKEN/project
Add the required headers:
Authorization: Bearer PROJECT_PRIVATE_KEY
Content-Type: application/json
HTTP Transaction Reporting
Transactions are sent to a separate endpoint:
https://dockray.io/api/v1/PROJECT_TOKEN/transaction
Each transaction can include the route name, HTTP method, response status code, event timestamp, environment, and runtime and application information.
The project's private key must not be included in browser-side code or exposed in any other publicly accessible location.