{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-country-apis-catalog/product-catalog/se/authenticate/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"type":"markdown"},"seo":{"title":"Requests and Responses"},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"__idx":0,"id":"requests-and-responses"},"children":["Requests and Responses"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"__idx":1,"id":"authentication-request"},"children":["Authentication Request"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The CONNECT Authenticate API uses a simple POST request with your username (User Key) and password to generate a JWT token."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"__idx":2,"id":"request-create-token"},"children":["Request: Create Token"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Endpoint:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"http","header":{"controls":{"copy":{}}},"source":"POST https://connect.creditsafe.com/v1/authenticate\n","lang":"http"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Headers:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"curl","header":{"controls":{"copy":{}}},"source":"Content-Type: application/json\n","lang":"curl"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Request Body:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"username\": \"myUsername\",\n  \"password\": \"myS3cretP@ssw0rd999!\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"__idx":3,"id":"request-parameters"},"children":["Request Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameter"},"children":["Parameter"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Data Type"},"children":["Data Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Max Length"},"children":["Max Length"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Required"},"children":["Required"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["username"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["30"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Your User Key as provided by Creditsafe (case-sensitive)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["password"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["30"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Your password as chosen by yourself (case-sensitive)"]}]}]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"Important: User Key vs Email"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["email-based usernames"]}," used for logging into Creditsafe websites are ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["NOT"]}," the same as the username required for our APIs. The username parameter must be your ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["User Key"]}," provided by Creditsafe. If you're unsure of your User Key, please contact Creditsafe integration support."]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"Case Sensitivity"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Both username and password are ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["case-sensitive"]},". Ensure you enter them exactly as provided."]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"__idx":4,"id":"response-created-token"},"children":["Response: Created Token"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"__idx":5,"id":"http-response-code-200-ok"},"children":["HTTP Response code: 200 OK"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"token\": \"eyJhbGciOiJSUzI1NiIsImtpZCI6Im…hPeGE7Ak8YtKFbA\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"__idx":6,"id":"response-parameters"},"children":["Response Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameter"},"children":["Parameter"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["token"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String - Token to be used when calling other Creditsafe REST APIs. Valid for 1 hour."]}]}]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"success","name":"Token Usage"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Copy the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["token"]}," value and include it in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Authorization"]}," header as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Bearer {token}"]}," for all subsequent API requests to any Creditsafe Sweden REST API."]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"__idx":7,"id":"how-to-include-authentication-token-as-a-request-header"},"children":["How to Include Authentication Token as a Request Header"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["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:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Example Request:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"HEADER: Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6Im…hPeGE7Ak8YtKFbA\nURL: https://se-webservice.apps.creditsafe.com/datecheck/company?searchnumber=5565144408&referencedate=2020-08-29&transactionid=Example&language=sv\nMethod: GET\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"__idx":8,"id":"token-lifecycle"},"children":["Token Lifecycle"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A successfully generated token is ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["valid for one hour"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["When your token expires, you can request a new one independently of the current token"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Multiple valid tokens can exist simultaneously"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Each token can be used with any of the supported services as long as it remains active"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"__idx":9,"id":"token-expiration-handling"},"children":["Token Expiration Handling"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When an expired token is used in a call, a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["403 HTTP Status (Token Expired)"]}," response will be returned."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"__idx":10,"id":"recommended-token-refresh-strategies"},"children":["Recommended Token Refresh Strategies"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Strategy 1: Reactive Refresh"]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Catch the 403 Token Expired response"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Refresh the token when needed"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Repeat the latest call that was denied"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Strategy 2: Proactive Refresh"]}," (Recommended)"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Track the timing of when the token was fetched"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Request a new token before the previous one expires"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Refresh approximately ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["55 minutes"]}," after the previous token was generated"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"__idx":11,"id":"example-complete-authentication-flow"},"children":["Example: Complete Authentication Flow"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Step 1: Authenticate"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST https://connect.creditsafe.com/v1/authenticate \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"username\":\"myUsername\",\"password\":\"myS3cretP@ssw0rd999!\"}'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Step 2: Receive Token"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"token\": \"eyJhbGciOiJSUzI1NiIsImtpZCI6Im…hPeGE7Ak8YtKFbA\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Step 3: Use Token in API Call"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X GET \"https://se-webservice.apps.creditsafe.com/datecheck/company?searchnumber=5565144408\" \\\n  -H \"Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6Im…hPeGE7Ak8YtKFbA\"\n","lang":"bash"},"children":[]}]},"headings":[{"value":"Requests and Responses","id":"requests-and-responses","depth":1},{"value":"Authentication Request","id":"authentication-request","depth":2},{"value":"Request: Create Token","id":"request-create-token","depth":2},{"value":"Request Parameters","id":"request-parameters","depth":3},{"value":"Response: Created Token","id":"response-created-token","depth":2},{"value":"HTTP Response code: 200 OK","id":"http-response-code-200-ok","depth":3},{"value":"Response Parameters","id":"response-parameters","depth":3},{"value":"How to Include Authentication Token as a Request Header","id":"how-to-include-authentication-token-as-a-request-header","depth":2},{"value":"Token Lifecycle","id":"token-lifecycle","depth":2},{"value":"Token Expiration Handling","id":"token-expiration-handling","depth":2},{"value":"Recommended Token Refresh Strategies","id":"recommended-token-refresh-strategies","depth":3},{"value":"Example: Complete Authentication Flow","id":"example-complete-authentication-flow","depth":2}],"frontmatter":{"seo":{"title":"Requests and Responses"}},"lastModified":"2026-04-28T11:14:53.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/country-apis-catalog/product-catalog/se/authenticate/documentation/requests-responses","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}