XBert Public API Documentation
Overview

The XBert Public API allows users to access their account data used by the main XBert application. Please note this API is a work in progress and is subject to breaking changes.

Currently, the API only offers methods to retrieve data. There is no way to add, update or delete any of your own data.

Authorization
Account

To use the XBert Public API, you must first have an account. You can follow the steps listed here to request an account.

OAuth

OAuth 2.0 is an authorization framework that enables applications to obtain limited access to user accounts. OAuth works over HTTPS and authorizes with Access Tokens rather than credentials.

The XBert Public API endpoints are protected by these Access Tokens. In order to call endpoints successfully, you must send an Access Token in the HTTP header of your API requests.

Scopes

OAuth Scopes are a mechanism used to limit access to a user's account data. When an Access Token is generated, it provides a set of scopes to define what data is allowed to be accessed. Your XBert Public API account will be setup with all scopes by default, unless otherwise requested.

Listed below are the current scopes. More scopes will be added as additional types of data are exposed by the XBert Public API.

  • offline_access
  • read:notifications
  • read:clients
Access Token

To request an Access Token, make a HTTP request to the following URL below. This endpoint uses the Resource Owner Credentials Grant Type to allow Access Token generation without needing a browser redirect to our identity server.

POST https://identity.xbert.io/connect/identity/token

Authorization: "Basic " + base64encode(email_address + ":" + password)
Content-Type: application/x-www-form-urlencoded

grant_type=authorization_code

This endpoint is protected by Basic Authentication. It will require an authorization header containing your XBert Public API account email address and password.

  • Authorization: "Basic " + base64encode(email_address + ":" + password)
The request body will need to contain the grant type (authorization_code) in URL encoded form (application/x-www-form-urlencoded).
  • grant_type=authorization_code

You will receive a response object containing various fields, including the Access Token and a Refresh Token, as you can see in the example below.

{
 "accessToken": "eyJhbGciOiJSUzI1NiIsInR5cC...",
 "refreshToken": "v1.MeOgD-KPFli...",
 "scope": "read:notifications read:clients offline_access",
 "expiresIn": 86400,
 "tokenType": "Bearer"
}

Token Expiration

All Access Tokens and Refresh Tokens expire after a set period of time. Access Tokens and Refresh Tokens can be exchanged prior to expiry, but not after.

Tokens have the following expiration times

  • Access Token: 1 Day
  • Refresh Token: 30 Days
Refresh Token

Once an Access Token has expired, you can use the Refresh Token to request a new Access Token. If the Refresh Token is also expired, you will need to request a new Access Token.
To refresh an Access Token, make a HTTP request to the following URL below.

POST https://identity.xbert.io/connect/identity/token

Authorization: "Basic " + base64encode(email_address + ":" + password)
Content-Type: application/x-www-form-urlencoded

grant_type=refresh_token&refresh_token=refresh_token

This endpoint is protected by Basic Authentication. It will require an authorization header containing your XBert Public API account email address and password.

  • Authorization: "Basic " + base64encode(email_address + ":" + password)
The request body will need to contain the grant type (refresh_token) as well as the Refresh Token in URL encoded form (application/x-www-form-urlencoded).
  • grant_type=refresh_token
  • refresh_token=refresh_token

API Requests

All requests to the XBert Public API must be sent over HTTPS.

Retrieving individual resources

To retrieve a specific resource you can append its identifier to the end of the URL. The example below shows retrieving a specific Notification using the HTTP GET method.

GET https://api.xbert.io/api/v1/Notifications/12345
Retrieving a list of resources

With some resources you may be allowed to retrieve multiple resources in a single API call. You can do this by simply using a HTTP GET with the resource name. An example call to list Notifications is shown below.

GET https://api.xbert.io/api/v1/Notifications

Retrieving a filtered list of resources

When retrieving a list of resources, you may want to refine the list of results. We allow certain optional parameters sent to the endpoint to allow for this. An example call to list Notifications with the LastModifiedTime filter parameter is shown below.

GET https://api.xbert.io/api/v1/Notifications?lastModifiedTime=2021-01-01T00:00:00.0000000Z

Retrieving a paged list of resources

When retrieving a list of resources there can be a lot of results. For that reason, we paginate the results to make sure responses are smaller and easier to handle.

Paginated endpoints require that the data is ordered, to ensure that results are returned consistently. All resources are ordered by the time and date of creation, in ascending order (oldest to newest).

Every list operation will require the same two paramaters to handle the paging of the request. These values are outlined below.

  • page: an Integer value starting at 1.
  • amount: an Integer value that must be between the values 1 - 100.

An example call to list Notifications with paging parameters is shown below.

GET https://api.xbert.io/api/v1/Notifications?page=1&amount=100

A paged result will always have the same data structure. The 'results' field will contain an array of the requested resource. This paged result structure is shown below.

{
 "page": 1,
 "amount": 100,
 "hasMorePages": false,
 "resultAmount": 80,
 "results": [...]
}

Rate Limiting

A rate limit is the number of API calls a user can make within a given time period. If this limit is exceeded the user will be throttled. API requests made by a throttled user will fail and receive a HTTP response of Too Many Requests (429).

Warning: During the beta phase, rate limiting policies are shared amongst all users. Each endpoint has its own individual policy and quota, rather than a single quota shared between all endpoints. This is temporary and will be changed during the beta phase.

The XBert Public API currently has three rate limit policies which are outlined below.

  • 20 Requests per minute
  • 200 Requests per hour
  • 1000 Requests per day

Every API response will contain three response headers: the request limit for the longest policy, the request amount remaining and the utc datetime when the amount remaining resets. These headers correspond to the rate limit policy for the longest period of time, which in this case is the daily rate limit policy. The example below shows the normal format of these rate limit headers

X-Rate-Limit-Limit 1d
X-Rate-Limit-Remaining 999
X-Rate-Limit-Reset 2026-01-01T00:00:00.0000000Z
API Responses

All successful API responses will contain JSON formatted data.

Any DateTimes sent by the server are always formatted as an ISO 8601 compliant string. An example of the exact format can be seen in the below example.

2026-01-01T12:59:59.9999999Z

Endpoints can return a variety of responses. The most common XBert Public API responses have been outlined below.

Response Code Description
200 OK Request was successful
301 Moved Permanently URL of resource has changed
400 Bad Request The request is invalid
401 Unauthorized Missing or invalid Access Token
403 Forbidden Access Token missing required scopes
429 Bad Request Rate limit exceeded - too many requests
500 Internal Server Error API has encountered an issue