info@selectline.de | +49 391 5555-080 | SelectLine - suits every company

Use of the API

In order to read or write data via the API, an HTTP call must be in a certain form. The API follows the conventions of a REST service from which the various service offerings are provided via corresponding URLs and HTTP connections. Each piece of information has a unique URL. To read the information, the HTTP verb GET should be used. For writing either the POST HTTP verb (create information) or the PUT HTTP verb (change information) is used.

JSON is used as the format in which information is received or transmitted. The response format is transmitted via the header as follows.:
ACCEPT: application/json

If data is transmitted, this format must also be defined:
CONTENT-TYPE: application/json

Many functions require authentication, which must be done by a login. The LoginId, which is obtained through the login, must always be included in the header of a call.:
Authorization: LoginId 12345-12345-12345-12345-12345


Login

To sign up for the API, an HTTP call must be made with the HTTP verb POST. The user name, password and AppKey are transmitted in the body of this call. The AppKey must be stored in the licence used. The format of the data must be specified in the header:

Url:
POST http://localhost/Login
Header:
CONTENT-TYPE: application/json
Body:
{ "username":"[UserName]", "password":"[Password]", "AppKey":"[AppKey]" }
With the correct username and password you will receive a response to the LoginId (Access Token).
{"AccessToken":"ec2fbd7c-a184-4849-ba9f-1a35782383a9", "TokenType":"LoginId"}

Read information

To retrieve a customer a GET Http request must be sent. In the URL the customer number must be specified. Retrieving customer requires authentication, so the LoginId must be specified in the header.

Url:
GET http://localhost/Customers/12345
Header
AUTHORIZATION: LoginId 12345-12345-12345-12345-12345
ACCEPT: application/json

Number of records - Pagination

By default, a GET route query that returns more than one record will return 10 records per page. By specifying "Items" it is possible to change the number of records per page. To retrieve all existing records, the value can be set to 0. For performance reasons, it may make sense to reduce this number. The desired page is called up via "Page".

Here is an example.; The result set is divided into pages of 20 records each and the 4th page is retrieved.;
Url:;
GET http://localhost/Documents?Items=20&Page=4


Create information

If a customer is to be created, the customer´s data must be transferred to the appropriate URL via POST. The format and authentication must be specified in the header. The properties of a customer, which are not to be transferred, are filled by the API with default values. The properties marked Read Only can not be written.

Url:
POST http://localhost/Customers
Header:
AUTHORIZATION: LoginId 12345-12345-12345-12345-12345
CONTENT-TYPE: application/json
Body
{"FirstName":"John", "LastName":"Doe" }

change information

To change a customer, a PUT HTTP request must be sent to the appropriate URL indicating the customer number. The format and authentication must be specified in the header. The properties of a customer that you do not transfer are not changed. The properties marked as read only can not be changed.

Url:
PUT http://localhost/Customers/12345
Header:
AUTHORIZATION: LoginId 12345-12345-12345-12345-12345
CONTENT-TYPE: application/json
Body:
{"LastName":"Smith" }