Prerequisites

You'll require the following information to be able to access the API:

  1. ClientId / ClientSecret

    This is a security pair that is required to retrieve an access token that is used to make calls to API. The credentials is shared to you as a customer when your environment is deployed. 

  2. API Url

    This is the URL you use to communicate with the API. Use the following URL to access our staging environment: Swagger UI

Authentication

Step 1: Retrieving a token

To retrieve a token for the ERP-API we use end point /api/identity and a POST-command. In the body you type in client-id and client-secret.

Example URL: https://erpapi-staging.bitlogwms.com/api/identity (

Example body:

  "clientId": "string",   "clientSecret": "string" }

Example response code:

    "resultCode": 1,     "message": "Success",     "isSuccess": true,     "errorDetails": [],     "metaData": [],     "result": {         "accessToken": "ExampleAuxvT71qn50KfhMBSDFHeYCdUu1qUJRBGA",         "expiresIn": 3599     } }

The duration of this token is 60 mins.


Step 2: Using token


The token you have retrieved will be used as Type = Bearer in your requests.

Example 1 shown from Postman:



Example 2 shown from Swagger:

Press the button Authorize in the upper right corner.


Type in Bearer followed by your token and press Authorize.


You can now send commands directly from Swagger.

 

Happy coding!
Bitlog Support team