API AUTHENTICATION

The API uses Bearer authentication (also called token authentication), a simple authentication scheme built into the HTTP protocol, that involves security tokens called bearer tokens. All API endpoints require this form of authentication. Failure to correctly authenticate an API request will result in a "401 Unauthorized" response.

The Authorization header can then be formed by including the word Bearer, followed by a single space character, followed by the API key generated.

Example:
Authorization: Bearer qrtts8ghj6c13kjoe

LOGIN

Login to the application and return the auth token for other API calls.

https://vt.pageier.com/api/login


AUTHORIZATION

All


QUERY PARAMETERS

Field Mandatory Type Description
username String The user's username
password String The user's password

RESPONSE

Field Type Description
CODE 200 Logged in successfully
token String The authentication token to use in API calls
login_url String The link to login directly without entering credentials
CODE 201 User is blocked
CODE 202 Incorrect password
CODE 203 Incorrect username

REGISTER

Allows to register a user from an external site.

https://vt.pageier.com/api/register


AUTHORIZATION

All - SaaS version


QUERY PARAMETERS

Field Mandatory Type Description
username String The user's username
email String The user's e-mail address
password String The user's password
id_plan Integer The id of the plan to associate to the user

RESPONSE

Field Type Description
CODE 200 User registered successfully
id_user Integer The id of the added user
validate_mail Boolean If the user need to validate it's account
CODE 201 Username already registered
CODE 202 E-Mail already registered

GET USERS

Retrieve the list of all the users.

GET https://vt.pageier.com/api/users


AUTHORIZATION

Administrator - SaaS version


QUERY PARAMETERS

Field Mandatory Type Description
token String The authentication token generated from login API
offset Integer The offset of the first item returned
limit Integer The maximum number of entries to return

RESPONSE

Field Type Description
CODE 200 Ok
data Array Contains the list of all the users
CODE 404 Users not found

GET USER

Retrieve a user's details.

GET https://vt.pageier.com/api/user


AUTHORIZATION

Administrator - SaaS version


QUERY PARAMETERS

Field Mandatory Type Description
token String The authentication token generated from login API
id Integer The id of the user

RESPONSE

Field Type Description
CODE 200 Ok
data Array Contains the user information
CODE 404 User not found

ADD USER

Adding a user by the administrator.

https://vt.pageier.com/api/user


AUTHORIZATION

Administrator - SaaS version


QUERY PARAMETERS

Field Mandatory Type Description
token String The authentication token generated from login API
username String The user's username
email String The user's e-mail address
password String The user's password
role Enum The user's role chosen from super_admin, administrator, editor, customer
id_plan Integer The id of the plan to associate to the user
first_name String The user's first name
last_name String The user's last name
company String The user's company
tax_id String The user's tax id
street String The user's address
city String The user's city
postal_code String The user's postal code
province String The user's province
country String The user's country
tel String The user's telephone number

RESPONSE

Field Type Description
CODE 200 User added successfully
id_user Integer The id of the added user
CODE 201 Username already registered
CODE 202 E-Mail already registered
CODE 406 Authorization issue
CODE 407 Invalid role value

EDIT USER

Editing a user by the administrator.

PUT https://vt.pageier.com/api/user


AUTHORIZATION

Administrator - SaaS version


QUERY PARAMETERS

Field Mandatory Type Description
token String The authentication token generated from login API
id_user Integer The id of the user
username String The user's username
email String The user's e-mail address
password String The user's password
role Enum The user's role chosen from super_admin, administrator, editor, customer
id_plan Integer The id of the plan to associate to the user
active Boolean The status of the user account
first_name String The user's first name
last_name String The user's last name
company String The user's company
tax_id String The user's tax id
street String The user's address
city String The user's city
postal_code String The user's postal code
province String The user's province
country String The user's country
tel String The user's telephone number

RESPONSE

Field Type Description
CODE 200 User updated successfully
CODE 201 Username already registered
CODE 202 E-Mail already registered
CODE 404 User id not found
CODE 406 Authorization issue
CODE 407 Invalid role value

GET PLANS

Get all the available subscription plans.

GET https://vt.pageier.com/api/plans


AUTHORIZATION

All - SaaS version


QUERY PARAMETERS

Field Mandatory Type Description
No parameters.

RESPONSE

Field Type Description
CODE 200 Ok
data Array Contains the list of all the plans
CODE 404 No plans found

GET SERVICES

Get all the available services to purchase.

GET https://vt.pageier.com/api/services


AUTHORIZATION

All - SaaS version


QUERY PARAMETERS

Field Mandatory Type Description
No parameters.

RESPONSE

Field Type Description
CODE 200 Ok
data Array Contains the list of all the services
CODE 404 No services found

GET TOURS

Retrieve the list of all the tours of the authenticated user.

GET https://vt.pageier.com/api/tours


AUTHORIZATION

All


QUERY PARAMETERS

Field Mandatory Type Description
token String The authentication token generated from login API
offset Integer The offset of the first item returned
limit Integer The maximum number of entries to return

RESPONSE

Field Type Description
CODE 200 Ok
data Array Contains the list of tours
CODE 404 Tours not found

GET TOUR STATISTICS

Retrieve the statistics of a desired tour of the authenticated user.

GET https://vt.pageier.com/api/tour_stats


AUTHORIZATION

All


QUERY PARAMETERS

Field Mandatory Type Description
token String The authentication token generated from login API
id_tour Integer The id of the tour (default all the tours)
type Enum The type of statistics chosen from all, unique (default all)

RESPONSE

Field Type Description
CODE 200 Ok
data Array Contains the statistics of the tour
CODE 404 Tour not found