When using Fuse’s APIs, you must obtain an auth token when authenticatingTo call the API you need to authenticate to it. In order to authenticate you must first obtain and use an authentication token. The method by which you obtain the authentication token differs depending on the API version you wish to use. Below you can find information specific to v4.4 and below, and v5.0 and above. Please refer to the version that is applicable to you.
Expand |
---|
|
v5.0 and aboveThis section includes information on how to obtain a valid authentication token when using the v5.0 and above of the Fuse API. To call Fuse API endpoints you need to be authenticated. This is done by sending your authentication token in a header called Auth-Token with every API request. From v5.0 |
...
onwards, we’ve introduced rotating |
...
authentication tokens, which means that each authentication token |
...
expires and renews at regular intervals. Panel |
---|
| Note: If you are using | a legacy an older version of Fuse’s API (v4.4 and below) | the process for obtaining a token differs. For information how to obtain auth tokens in please expand the v4.4 and below | , see here. section and refer to the information there. |
Getting a tokenTo obtain |
...
your authentication token, you must use the following |
...
...
...
...
https://<instance_name>.fuseuniversal.com/api/v5.0/session
Method: POST Request parametersWhen using this request, you must include the following mandatory parameters in the request body: |
...
Example response Code Block |
---|
| {
"success": true,
"role": "admin",
"administerable_community_ids": [
9,
10,
11
],
"admin_group_permissions": [
"compliance_reporting"
] | ,
"is_manager": trueterms_and_conditions_accepted": true,
"password_change_required": false,
"terms_and_conditions": null,
"password_requirements": null,
"jwt_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJIb3RmaXgiLCJleHAiOjE3MzIxNDcxOTksImlhdCI6MTcyOTUwNTc3NiwiYXVkIjpudWxsLCJqdGkiOiIyOTQ5OS4xOTI4NTYifQ.qz_fLuuTvyUTveheP8bwLwnDBgw_KpjZTdMEUf2WSnY",
"auth_tokens": {
"jwt_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJIb3RmaXgiLCJleHAiOjE3MzIxNDcxOTksImlhdCI6MTcyOTUwNTc3NiwiYXVkIjpudWxsLCJqdGkiOiIyOTQ5OS4xOTI4NTYifQ.qz_fLuuTvyUTveheP8bwLwnDBgw_KpjZTdMEUf2WSnY",
"user_authentication_token": {
"authentication_token": "RVt-k4zQJRyMBx3L",
"updated_at": 1728784853
}
}
} |
|
Obtaining a token using cURL
The path to the authentication token is .auth_tokens.user_authentication_token.authentication_token . In the example above the authentication token is RVt-k4zQJRyMBx3L . Info |
---|
For more information about the /session endpoint, please reference the API documentation section in the Admin Panel of your instance: Image Added |
Using the token For API v5 the authentication token must be presented in an Auth-Token request header along with the request. Below is an example of |
...
...
...
...
RVt-k4zQJRyMBx3L' https:// |
|
...
<instance>.fuseuniversal.com/api/v5.0/users/me |
|
...
If the token is no longer valid then you will receive a 401 response such as in the example below:
authentication_tokenrVIG4LQ8kNvyu763,updated_at 1728957654
} |
Info |
---|
When using the legacy Fuse API (v4.4 and below), the request is as follows: curl In this case you will need to try getting the latest token using the POST /session endpoint as stated above. |
Expand |
---|
|
v4.4 and belowThis section includes information on how to obtain a valid authentication token when using the v4.4 and below of the Fuse API. Panel |
---|
| Note: If you are using v5.0 and above of Fuse’s API please expand the v5.0 and above section and refer to the information there. |
Note |
---|
Fuse field names are case-sensitive. If a field does not update or you are getting a bad response, check that the field name being sent within the request matches the field name on Fuse. |
Authentication tokenAuthentication tokens can be obtained in the Admin panel of a Fuse instance or from an API client, such as Postman or cURL. Generating an auth token in PostmanFollow these steps: Select your workspace. Create a request Set the HTTP method to POST . Enter the Fuse instance URL:
https://<instance_name>.fuseuniversal.com/api/v4. 0/users/me?auth_token=1234abcd |
JavaScript <<Francois to provide specific examples>>
...
For more information about the POST: /session
endpoint, please reference the API documentation section in the Admin Panel of your instance:
...
4/token
Select Body tab. Select form-data sub-tab. Set a couple of key-value pairs: Press the Enter key or click on the Send button. Expected Status Code: 201 Created Make a note of the auth_token value from the response body to use for requests in later Manage Users Endpoint Examples.
Info |
---|
Example of auth_token with valid URL: https://<instance_name>.fuseuniversal.com/?auth_token=Rn26mdxAs1_jjzVt__ySga
|
Use the following screenshot as a reference in the previous steps: Image Added
Generating an auth token in cURLTo generate an auth_token in cURL, run the following command: Code Block |
---|
| curl --location --request POST 'https://<instance_name>.fuseuniversal.com/api/v4.4/token' --form 'login_name=<api_user>' --form 'password=<api_user_password>’' |
|