βοΈAPI documentation
API and Webhook Integration Notes
Integrating APIs and Webhooks should be carried out by personnel with relevant backgrounds inengineering or technical staff, the FIRST LINE customer service teamdoes not provide this type of technical support services.
We recommend that you evaluate your internal technical resources before proceeding. If you have further integration needs or require assistance, you can also refer to ouradvanced paid technical support services, to receive more comprehensive technical assistance and implementation recommendations.
Obtain Token
Using the API requires token authentication, and each agent's token is independent and does not affect or invalidate others. The APIs a token can access depend on the permissions associated with the employee data. For example, a token for an employee with "agent" permissions will not be able to use many management-related APIs.
You can obtain it through the following two methods:
Get Token
To use the API, authentication is required through a token. Each agent has an independent token, and they do not interfere with or invalidate each other. The scope of API access for a token is determined by the employee data permissions. For instance, a token with "agent" permissions will be unable to access various management-related APIs.
It can be obtained through two methods:
Obtain via the employee interface in the system
After an administrator logs into FIRST LINE, go to the left menu and select "System" > "Employee", find the employee account that will use the API, click "Generate", and a permanent token will be created. If a new key is regenerated, the previous token belonging to that employee will immediately become invalid.
Via the Employee Interface in the System
When an admin logs into FIRST LINE, navigate to the "System" > "Employee" option in the left menu. Locate the employee account for which you want to generate a token and click on "Generate." This action will create a permanent token. If a new key is generated, the old token belonging to that employee will immediately become invalid.

Obtain via API
You can also generate a new token using the user's username and password; the usage is as follows. Each time a new token is obtained, the old token will immediately become invalid. Depending on the usage scenario and security considerations, you only need to obtain it according to the configured cycle.
Get Token via API
You can also generate a new token through the API using the user's username and password. The process is as follows: each time a new token is obtained, the old token will immediately become invalid. Depending on the usage scenario and security considerations, it is recommended to obtain a new token based on the configured period.
Obtain Token
POST https://{API_HOST}/api/v1/auth
Path Parameters
ttl
integer
Key expiration time in minutes; default is 60 minutes. Enter 52560000 minutes for long-term use.
password*
string
user password
name*
string
user account
Refresh Token
PUT https://{API_HOST}/api/v1/auth
Request Body
name
string
user account.
password
string
user password.
ttl
number
Key expiration time in minutes; default is 60 minutes.
Revoke Token
PUT https://{API_HOST}/api/v1/auth/logout
Revoke the currently used token, equivalent to logging out the user.
Request Body
name
string
user account.
password
string
user password.
Usage
After obtaining the token, you can use that token to perform various API operations that correspond to the system permissions of the account. FIRST LINE's API requests can validate the token (access token) using one of the following two methods.
Usage
After obtaining the token, you can perform various API operations corresponding to the system permissions associated with the account. FIRST LINE API requests can be authenticated using one of the following two methods with the access token.
Authorization header
Authorization: Bearer eyJhbGciOiJIUzI1NiI...
Query string parameter
https://{API_HOST}/api/v1/some-what?token=eyJhbGciOiJIUzI1NiI...
π Need an expert to provide API development and integration support?
We offer additional paid professional services to help you successfully integrate internal and external systems, including data flow integration for bot scripts. We are committed to refining API strategy deployment and data integration to ensure smooth system integration and provide the best user experience.
Our professional team will provide you with comprehensive support to ensure your needs are effectively addressed.
Last updated