Authentication
This guide explains how to register a REST application, request an access token, and use that token to authenticate requests against the SmartConnect REST API.
Overview
To authenticate with the SmartConnect REST API, first create a REST application registration in SmartConnect.com. That registration provides the client_id and client_secret required to request an access token. Once a token is returned, include it as a Bearer token in the Authorization header for subsequent API requests.
Register a REST Application
- Navigate to System >> API Settings.
- In REST Application Registrations, click Add Registration.
- Enter a name and choose Web API for the type.
- Click Activate. This generates a client secret.
- Click the arrow icon to the left of the registration name to reveal the secret.
- Name the secret for future reference.
client_id and client_secret. You will use both values when requesting a token.
Request an Access Token
POST request to the token endpoint for your SmartConnect region using application/x-www-form-urlencoded.
Token Endpoints by Region
| Region | Token Endpoint |
|---|---|
| NA | https://apina.smartconnect.com/token |
| NA2 | https://apina2.smartconnect.com/token |
| NA3 | https://apina3.smartconnect.com/token |
| UK | https://apieuk.smartconnect.com/token |
| EU | https://apieuw.smartconnect.com/token |
| EU2 | https://apieuw2.smartconnect.com/token |
| AU | https://apiau.smartconnect.com/token |
Request Details
Form Body Parameters
| Parameter | Required | Description |
|---|---|---|
grant_type |
Yes | Must be password |
username |
Yes | User’s email address |
password |
Yes | User’s password |
client_id |
Yes | Client ID generated during REST application registration |
client_secret |
Yes | Client Secret generated during REST application registration |
Example Request
POST /token HTTP/1.1 Host: apina.smartconnect.com Content-Type: application/x-www-form-urlencoded grant_type=password& username=user@example.com& password=yourpassword& client_id=your_client_id& client_secret=your_client_secret
Example Response
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI...",
"token_type": "bearer"
}
Use the Access Token
After the token request succeeds, use the returned access token as a Bearer token in the Authorization header on all available endpoints.
Authorization: Bearer {access_token}
Swagger UI Endpoints
Use the Swagger UI for your region to view and test the available API endpoints.
Notes
- The returned access token is required for authenticated API requests.
- Store your client secret securely.
- Use the Swagger UI endpoint that matches your SmartConnect region.