User Activity API

The BindID Service exposes an HTTP /user/activity/fetch endpoint, which can be used to retrieve user authentication and transaction events.

Note: Each query is limited to a 30 day period and up to 100 results are returned in each response. However, multiple requests can be used to fetch additional results and cover multiple timeframes. Also, note that access token is valid for 60 minutes from the time it is issued.

HTTP Request

The API is invoked as a POST request to the following endpoint:

https://<host-name>/user/activity/fetch

where <host-name> has the following value depending on the environment:

  • Sandbox: api.bindid-sandbox.io
  • Production: api.bindid.io
  • Production EU: api.eu.bindid.io

Request Headers

The POST request must include the following HTTP headers:

Header NameDescription
AuthorizationIncludes authorization for API access. For the header structure, see Introduction.
Content-TypeShould be set to application/json.

Request Parameters

The body for this POST request is a JSON object, with the following fields:

ParameterDescriptionType
fromTimeRequired. Time from which user events are retrieved (inclusive), in unix-epoch milliseconds.Number
toTimeRequired. Time to which user events are retrieved (exclusive), in unix-epoch milliseconds. The maximum value between the fromTime and toTime cannot be more than 30 days.Number
skipOptional. Determines the number of events which are not retrieved, starting from the newest events. The maximum allowed value is 10,000.Number
subject_session_atOptional. Access token for the BindID session.String

Request Example

POST /user/activity/fetch HTTP/1.1
Content-Type: application/json
Authorization: BindIdBackend AccessToken to33lpl...zW7BM; bGAH...FnzcaYvFf6djg=
{
"fromTime": 1640583117000,
"toTime": 1640593920000,
"skip": 1,
"subject_session_at": "to33lpl...zW7BM"
}

Response Headers

The POST response includes the following HTTP headers:

Header NameDescription
Content-TypeReturns application/json

Response Body

The JSON object in the body has the following structure:

Field NameDescriptionType
status_codeIndicates call success.String
dataObject containing user event information.data

data Object

Field NameDescriptionType
countThe number of returned user events (the maximum number of returned events is 100).Number
totalThe total number of user events found during the specified timeframe (including events that were not retrieved).Number
eventsArray containing the returned user events.Array of events objects

events Objects

Field NameDescriptionType
accessingDeviceObject that contains a description field (string) with details of the device used to create the event (OS type, OS version, browser type, and browser version).accessingDevice
appApplication ID of the app in which the event was createdString
authenticatingDeviceObject that contains a description field (string) with details of the device used to authenticate the user (OS type, OS version, browser type, and browser version).authenticatingDevice
locationObject containing location details of the device used to create the event: city (string), state (string), and country (string).location
statusIndicates event success, can be success, failure, or incomplete (for events that were not completed).String
subUnique ID of the user who created the event.String
timestampTime the event occurred, in unix-epoch milliseconds.Number
userAliasAlias of the user who created the event, if one was set.String

Response Example

HTTP/1.1 200 OK
Content-Type: application/json
{
"status_code": "ok",
"data": {
"count": 1,
"total": 2,
"events": [
{
"timestamp": 1640674333814,
"status": "success",
"sub": "4b50c5c2-1385-4494-8462-2904d93d480c",
"userAlias": "example@mail.com",
"app": "branding_preview_app",
"authenticatingDevice": {
"description": "iOS 15.2, Mobile Safari 15.2"
},
"accessingDevice": {
"description": "Mac OS 10.15.7, Chrome 96.0.4664.110"
},
"location": {
"city": "Tel Aviv",
"state": "Tel Aviv",
"country": "IL"
}
}
]
}
}