The CONNECT Authenticate API uses a simple POST request with your username (User Key) and password to generate a JWT token.
Endpoint:
POST https://connect.creditsafe.com/v1/authenticateHeaders:
Content-Type: application/jsonRequest Body:
{
"username": "myUsername",
"password": "myS3cretP@ssw0rd999!"
}| Parameter | Data Type | Max Length | Required | Description |
|---|---|---|---|---|
| username | String | 30 | Yes | Your User Key as provided by Creditsafe (case-sensitive) |
| password | String | 30 | Yes | Your password as chosen by yourself (case-sensitive) |
The email-based usernames used for logging into Creditsafe websites are NOT the same as the username required for our APIs. The username parameter must be your User Key provided by Creditsafe. If you're unsure of your User Key, please contact Creditsafe integration support.
Both username and password are case-sensitive. Ensure you enter them exactly as provided.
{
"token": "eyJhbGciOiJSUzI1NiIsImtpZCI6Im…hPeGE7Ak8YtKFbA"
}| Parameter | Description |
|---|---|
| token | String - Token to be used when calling other Creditsafe REST APIs. Valid for 1 hour. |
Copy the token value and include it in the Authorization header as Bearer {token} for all subsequent API requests to any Creditsafe Sweden REST API.
Below is an example of how a web service call includes a token in the header. In this example, we are using the datecheck/company service:
Example Request:
HEADER: Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6Im…hPeGE7Ak8YtKFbA
URL: https://se-webservice.apps.creditsafe.com/datecheck/company?searchnumber=5565144408&referencedate=2020-08-29&transactionid=Example&language=sv
Method: GET- A successfully generated token is valid for one hour
- When your token expires, you can request a new one independently of the current token
- Multiple valid tokens can exist simultaneously
- Each token can be used with any of the supported services as long as it remains active
When an expired token is used in a call, a 403 HTTP Status (Token Expired) response will be returned.
Strategy 1: Reactive Refresh
- Catch the 403 Token Expired response
- Refresh the token when needed
- Repeat the latest call that was denied
Strategy 2: Proactive Refresh (Recommended)
- Track the timing of when the token was fetched
- Request a new token before the previous one expires
- Refresh approximately 55 minutes after the previous token was generated
Step 1: Authenticate
curl -X POST https://connect.creditsafe.com/v1/authenticate \
-H "Content-Type: application/json" \
-d '{"username":"myUsername","password":"myS3cretP@ssw0rd999!"}'Step 2: Receive Token
{
"token": "eyJhbGciOiJSUzI1NiIsImtpZCI6Im…hPeGE7Ak8YtKFbA"
}Step 3: Use Token in API Call
curl -X GET "https://se-webservice.apps.creditsafe.com/datecheck/company?searchnumber=5565144408" \
-H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6Im…hPeGE7Ak8YtKFbA"