Documentation - V1

Last updated: August 21th, 2023

Overview

Sapiti.net is an API service that allows developers to easily access information from multiple modern ticketing software’s at once. Since this is the very beginning of the project, we are starting with the Belgian software called UTick. Once the project will be running, we will add the support of other software’s. The definition of the API will not change by adding supported ticketing platforms.

Access to the API

According to your usage, our Team will provide 2 different access keys according to your need :

An Application public and secret keys
  • To access the agenda (events) of multiple partners
  • To manage the agenda of a specific partner
  • To book seats for an event
A Device Id
  • To access the agenda (events) of a specific partner
  • To control the access for an event (scanners)
  • To print the ticket of an event

You can request access to Sapiti Api by

Test URL

https://sapiti.ovh/v1

Live URL

https://sapiti.net/v1

Testing the server availability

/ping

Access control : none

This simple call return a basic 'pong' response :


{
    "success": true,
    "response": {
        "message": "pong"
    },
    "environment": "test",
    "api_version": 1,
    "datetime": "2020-03-04T10:18:58+01:00",
    "cached": false,
    "status_code": 200,
   "language": "fr"
}

                

Response

The API response to your request has the following structure :


{
    "success": true,
    "response": {
    },
    "environment": "test",
    "api_version": 1,
    "datetime": "2020-03-04T10:18:58+01:00",
    "cached": false,
    "status_code": 200,
    "language": "fr"
}

                
Parameter Values Description
success true / false has the request been successfully processed
response json formatted / null the content of the response
environment test / prod our current environment
api_version 1 the current version of the API
datetime iso 8601 date string our current server time
cached true / false does the response come from our cache (for efficiency)
status_code integer the response status code
language string the current content language

Status codes

The following status codes are return in the response header :

Code Description
200 success
400 bad request
401 unauthorized
403 access denied
404 ressource not found
500 internal error

Error codes

In case of error, the response looks like this :


{
    "success": false,
    "response": null,
    "error": {
        "code": 1501,
        "message": "id not found"
    },
    "environment": "test",
    "api_version": 1,
    "datetime": "2020-03-04T11:33:38+01:00",
    "cached": false,
    "status_code": 404
}

                
Error code Description
1000 method not allowed
1020 invalid json syntax
1050 A required parameter is missing
1051 A parameter is invalid
1100 Authentication required
1101 Invalid signature
1501 Provided id not found

Identification

For Applications

Every request’s body must contain at least this mandatory information: your public key, the current timestamp and a signature.

Example:


{
"publickey":"27A77FC5-4118-B3F9-ABF9-E1F82932ED6B",
"timestamp":"2020-03-03T15:46:46+01:00",
"signature":"e276b48bc7d899ff17a4e899e71ad16f7e84ec0bd608a6bb5c75c6bab878db9",
"language": "fr"
}
                

The time stamp (iso 8601 date string) must be within a 30 seconds range according to our server’s clock.
The signature is generated by a hash function on the concatenated public key and time stamp using your private key

PHP implementation:


$timeStamp= date('c');
$stringToEncore=$publicKey.$timeStamp;
$signature = hash_hmac("sha256", $stringToEncore, $privateKey);
                

Download

The following libraries are currently available

PHP Library

The PHP library is available on Github: https://github.com/mediamorphose/SapitiClient

If you are using composer, just run the following to add the Sapiti API library to your project:

composer require mediamorphosebe/sapiti-client