Files
Sentri-docs/API/API Getting Started.md
2026-05-31 00:26:38 +02:00

26 lines
1.5 KiB
Markdown

# API Getting Started
This document will explain how to get started with the Sentri API.
## Requirements
To connect to the Sentri API, you will need the following:
- A basic understanding of how APIs work, along with some programming or scripting experience.
- The Sentri base URL.
- An API bearer token.
- HTTPS access from the devices making API requests to the Sentri.
## Creating a authentication bearer token
Make sure you have the `user-apitoken-self` read/write permission, as this allows you to create an authentication bearer token.
Once logged in, go to your profile at `/userprofile` and click Generate API Token.
A token will be displayed, as shown below. This token will be used as the authentication bearer token, so make sure to copy it as it will only be shown once.
```
c8aaf11d-e10e-11f0-9b16-00155d00153f.83f0383262a4875f6c6d4bb5aa8577818ca7f71cb2ba80b9e9b9cb43f5b86831
```
## Trouble shooting
When you encounter a problem with the API, you will most likely receive an HTTP status code in the response. This code can help indicate the nature of the issue.
### Response codes
These are some of the response codes you may receive when making a call to the API:
## Method override
Some web servers (such as Nginx) may restrict direct use of PUT and DELETE requests, which can result in a 405 Method Not Allowed response.
To work around this limitation, you can send a POST request and include the `X-HTTP-Method-Override` header to indicate the intended HTTP method (e.g., PUT or DELETE). This will be reflected in the API request examples.