Returns the audit log for a project.
Endpoint | Supported methods | Full URL |
---|---|---|
/api/v1/projects/<YOUR_PROJECT_ID>/audit | GET | api.mpin.io/api/v1/projects/<YOUR_PROJECT_ID>/audit |
# Endpoint Authentication
-
Basic - The Client ID and Client Secret are used as a username:password pair for the HTTP Basic authentication of the request.
Authorization: "Basic <base64(<YOUR_CLIENT_ID:YOUR_CLIENT_SECRET>)>"
-
Bearer - A service account issued by MIRACL Trust that enables back-end services to access MIRACL Trust’s back-end APIs.
Each service account is assigned a token by MIRACL Trust. This token must be included in the Authorization header of API requests, using the standard Bearer token format:
Authorization: "Bearer <YOUR_SERVICE_ACCOUNT_TOKEN>"
For more information, see Create a Service Account.
# Parameters
Name | Type | Required | Description |
---|---|---|---|
projectId | Path | True | Project ID |
applicationId | Query | False | Application ID |
fromDate | Query | False | Start date of the period |
toDate | Query | False | End date of the period |
userId | Query | False | User ID by which to filter the result set |
mpinId | Query | False | MPin ID by which to filter the result set |
deviceName | Query | False | Device name by which to filter the result set |
offset | Query | False | List offset |
limit | Query | False | List response limit |
# Request Example
curl \
--user "${YOUR_CLIENT_ID}:${YOUR_CLIENT_SECRET}" \
"https://api.mpin.io/api/v1/projects/${YOUR_PROJECT_ID}/audit?fromDate=2021-06-01T00:00:00Z&toDate=2021-07-01T00:00:00Z&userId=${USER_ID}&limit=10&offset=0"
# Response Example
{
"total": 1,
"list": [
{
"IPAddress": "87.227.194.151",
"appID": "353f337f-ed78-4436-8f3c-5389ed83555c",
"appName": "Test",
"country": "UK",
"createdAt": "2021-10-01T07:52:27.204579Z",
"deviceName": "Chrome on Linux",
"eventStatus": "authenticate_success",
"eventType": "authentication",
"mpinID": "c324f5e55e377de0343f37019ad5b77b8b01bdfee40014a54d76fd934e36a792",
"userID": "test@example.com"
}
]
}
# Errors
# UNAUTHORIZED
The request needs to be authenticated with valid Client ID and Client Secret. For more information, see the Endpoint Authentication section above.
{
"error": "UNAUTHORIZED",
"info": "Access not allowed due to invalid credentials."
}
# FORBIDDEN
The request has been authorised with credentials that lack permissions for the requested project.
{
"error": "FORBIDDEN",
"info": "The request is forbidden."
}
# INVALID_REQUEST_PARAMETERS
Missing or invalid parameters from the request. You can see the affected
parameter(s) in the context
of the error. For information about the possible
parameters, see the Parameters section above.
{
"error": "INVALID_REQUEST_PARAMETERS",
"info": "Missing or invalid parameters from the request.",
"context": {
"params": "projectId"
}
}
# METHOD_NOT_ALLOWED
The request was made using an incorrect HTTP method.
{
"error": "METHOD_NOT_ALLOWED",
"info": "The request method is not allowed."
}