Introduction

Last updated last month

Starting guide for 1Pilot API

Generate Access Token

For use the API you need to have an Access Token, you can generate one from your Profile page by clicking on "Create New Token" button. On the modal set a name and choose if this token will have Write access to the API (write access mean you can create sites and tags via the API) once done click on create button and save securely the token: it's the only one time it will be shown.

Authentication

For use the API, you need to authenticate your requests by providing your previously generated token as a bearer token in the "Authorization" HTTP header like following :

Authorization: Bearer $YOUR_TOKEN

get
Test call

https://app.1pilot.io/api/v1
/ping
A simple ping request for test your are correctly authenticated
Request
Response
Headers
Authorization
required
string
Authentication Token value: Bearer $TOKEN
Accept
optional
string
application/json
200: OK
You are successfully authenticated.
{
"message": "pong"
}
401: Unauthorized
You have not provided the Authorization header or the provided one is wrong
{
"message": "Unauthenticated."
}
404: Not Found
Wrong URL
{
"message": ""
}

Pagination

All list results are paginated with "links" & "meta" informations in the response body

{
"data": [
[...]
],
"links": {
"first": "https://app.1pilot.io/api/v1/sites/1/logs?page=1",
"last": "https://app.1pilot.io/api/v1/sites/1/logs?page=4",
"prev": "https://app.1pilot.io/api/v1/sites/1/logs?page=1",
"next": "https://app.1pilot.io/api/v1/sites/1/logs?page=3"
},
"meta": {
"current_page": 2,
"from": 16,
"last_page": 4,
"path": "https://app.1pilot.io/api/v1/sites/1/logs",
"per_page": 15,
"to": 30,
"total": 53
}
}

You can use the page query parameters for follow the pagination.