Getting started!¶
Prerequisites¶
flinkey box which is not yet assigned to a car and having a valid service
flinkey-API-Key (value can be found at the Developer
page of the flinkey Portal)
API Manager credentials - The credentials are given in the developer registration mail
Step-by-Step Guide¶
1. Download Postman collection¶
Our Step-by-Step Guide is provided as Postman collection. Please download and install Postman firstly if you haven't done it yet. Then click on the following button to get your copy of the flinkey API Postman collection:
After getting your copy of the flinkey API Postman collection set the Postman environment to flinkey API v3 Step-by-Step Guide
.
1.1. Placeholder texts¶
The placeholder texts of the requests in the Postman collection which need to be changed by you in the next steps of this Step-by-Step Guide are always given in the following format:
{Your sample placeholder changes here}
Please note:
- Only text enclosed by single curly braces is a placeholder text.
- If you replace a placeholder text, also remove the single curly braces.
2. Authentication¶
The second thing we need to do is getting an authentication token. In your Postman collection copy of the flinkey API: expand the Authentication API
folder and then select the request Get token
. Please fill in all given parameters in the Body
tab of the request that only contain placeholder texts. Also set the CURRENT VALUE
of the field Your-flinkey-API-Key
of the Postman environment flinkey API v3 Step-by-Step Guide
. Then click Send
in Postman. You should receive a response like this:
Response¶
200 OK
{
"token_type": "Bearer",
"expires_in": "3600",
"access_token": "eyJ0eXAiOiJ..."
}
The property access_token
of the JSON response is the token we need to make calls to the other flinkey API endpoints. The property token_type
of the JSON response indicates the type of the token. The property expires_in
of the JSON response indicates how many seconds the access_token
is valid for.
3. Get customers¶
The third step is getting the customers of the API Manager you received a token for in the previous step. In your Postman collection copy of the flinkey API: expand the Customer API
folder and then select the request Get customers
. Then click Send
in Postman. You should receive a response as follows:
Response¶
200 OK
[
{
"id": 1,
"name": "TestName"
}
]
The response is the list of customers your API Manager account is assigned to. Normally, there is only one customer in the array.
4. Create car¶
The fourth step is creating a car. In your Postman collection copy of the flinkey API: expand the Car API
folder and then select the request Create car
. Please fill in the name parameter in the Body
tab. Remove the other optional parameters in the Body
tab you didn't fill in. Then click Send
in Postman. You should receive a response as follows:
Response¶
201 CREATED
{
"id": 1025
}
The response just contains the ID of the newly created car.
5. Install flinkey box into car¶
The fifth step is installing the box into the car. In your Postman collection copy of the flinkey API: expand the Car API
folder and then select the request Install flinkey box into car
. Please fill in the flinkey box serial number or unique ID in the Body
tab. Please find the serial number and unique ID of your box on the box itself. Remove the other optional parameter in the Body
tab you didn't fill in. Then click Send
in Postman. You should receive a response similar to this:
Response¶
204 NO CONTENT
The response status code indicates that the installation succeeded.
6. Create user¶
The sixth step is creating the user. In your Postman collection copy of the flinkey API: expand the User API
folder and then select the request Create user
. Please fill in the e-mail address parameter in the Body
tab of the request. Also fill in the optional parameters in the Body
tab as you wish that only contain placeholder texts. Remove the other optional parameters in the Body
tab you didn't fill in. Then click Send
in Postman. You should receive a response as this:
Response¶
201 CREATED
{
"id": 2143,
"password": "SamplePassword"
}
The property id
of the JSON response is the ID of the newly created user. The property password
of the JSON response is the password of the newly created user.
7. Assign user to car¶
The seventh step is assigning the user to the car. In your Postman collection copy of the flinkey API: expand the Car API
folder and then select the request Assign user to car
. Please fill in the placeholders in the Body
tab. Please note that they will be processed in the flinkey API in UTC timezone with the format: yyyy-MM-ddTHH:mm:ssZ
. You could also remove the end
parameter in the Body
tab to create an unrestricted assignment. Then click Send
in Postman. You should receive a response like this:
Response¶
204 NO CONTENT
Info
Assignments are set asynchronously. You will receive the response of the operation via webhook. More detailed information could be found here.
8. Finish¶
Now you are good to go! The user you created in this Step-by-Step Guide is able to open/close the car you also created previously in this tutorial. Just download the flinkey app and have a test.