How to authenticate your requests to portierX's API
You'll need to authenticate your requests to access most of the endpoints in the portierX API. In this guide, we'll look at how authentication works.To authenticate API requests, include the Authorization
header with a Bearer
or Token
type:# Using Personal Access Token (PAT)
curl --request POST \
--url https://api.portierx.com/api/v1/locking-system/overview \
--header 'Authorization: Token eyJhbGciOiJSUz......'
# Using JWT
curl --request POST \
--url https://api.portierx.com/api/v1/locking-system/overview \
--header 'Authorization: Bearer eyJhbGciOiJSUz......'
How to Get an Authenticate Token#
There are two options for obtaining an authentication token:1. Personal Access Token (PAT) for Service Users (Simpler)#
1.
Open your portierx portal, click your organization name in bottom of the sidebar and click User Management Settings
2.
You will be redirected to the user management settings page. Click Service Users
in the navbar and New
to create a new service user.
3.
Fill the form to create a new service user.
4.
After creating the service user, you will be redirected to the service user details page. Click Create Token
to create a new personal access token.
5.
You will be asked for expired date and get the token. The token will be displayed only once, so make sure to copy it.
6.
After that, you can use the token to authenticate your requests. For example, to get the overview of the locking system:
curl --request GET \
--url https://api.portierx.com/api/v1/locking-system/overview \
--header 'Authorization: Token {PAT}'
7.
You may want to add an appropriate role for the service user to limit its access. You can visit the Roles and Permissions documentation for more information. 2. OAuth 2.0 Token (Most Secure)#
We are actively working on our API. The documentation and implementation described here may not yet be fully aligned.