API Documentation

Overview


REST API

The R-Engine API is a RESTful API. This means that the API is designed to allow you to get, create, update, & delete objects with the HTTP verbs GET, POST, PUT, PATCH, & DELETE.

Response Type (JSON)

The R-Engine API responses are exclusively in JSON format. This means that you should always set the Content-Type header to application/json to ensure that your requests are properly accepted and processed by the API.

Authentication (Basic)

R-Engine’s REST API is protected by the same restrictions which are provided via R-Engine standard web interface. This means that if you do not log in, you will not have any access to R-Engine Information. Furthermore, if you log in and do not have permission to view something in R-Engine, you will not be able to view it using the R-Engine REST API either.

Because we are using R-Engine backend authedication credentials we should define them at the API call. Credentials should be encoded with Base64. The header is formatted like so.

 Authorization: Basic -u $USERNAME:$PASSWORD 

Version (v1)

The R-Engine API is constantly being worked on to add features, make improvements, and fix bugs. This means that you should expect changes to be introduced and documented. Whenever we make a significant change to an endpoint, we will increase the version number used in the path of the resource being requested.

However, there are some changes or additions that are considered backwards-compatible and your applications should be flexible enough to handle them. These include:

  • Adding new endpoints to the API
  • Adding new attributes to the response of an existing endpoint
  • Changing the order of attributes of responses (JSON by definition is an object of unordered key/value pairs)

Because we aren’t versioning the API in the URI we need to define an Accept header to request a specific version. The header is formatted like so.

 Accept: application/vnd.rengine.v1+json 

API Endpoints

R-Engine API calls should be done at the below URL:

 https://secure.reservationengine.net/rest 
Method Endpoint Description
GET /api/services List services
GET /api/services/{service_id},{service_id},… Get specific service details
GET /api/companies Get logged in user related companies
GET /api/companies/{company_id},{company_id},… Get specific companies details
GET /api/brands Get all services brands (e.g. VW, Mercedes)
GET /api/brands/{brand_id},{brand_id},… Get specific brand details
GET /api/attributes Get all services attributes (e.g. cc, persons, buggage)
GET /api/attributes/{attribute_id},{attribute_id},… Get specific attributes details
GET /api/orders Get logged in user related orders
GET /api/orders/{order_id},{order_id},… Get specific orders details
POST /api/orders Check and create new order
PATCH /api/orders/{order_id} Cancel and create a new. You cannot update an existing order.
PATCH /api/orders/estimate/{order_id} Check the total cost and the availability of an existing order.
DELETE /api/orders/{order_id} Check and cancel an existing order.
GET /api/customers Get logged in user customers
GET /api/customers/{customer_id},{customer_id},… Get specific customers details
POST /api/customers Create a new customer
PATCH /api/customers/{customer_id} Create a new customer
POST /api/payments/{order_id} Create a new payment for a specific order