Chat with us, powered by LiveChat

API keys

Getting an API key to make use of Lorry Route in your application is easy. Simply use your driver login and make the following API request to generate your own key.

URI scheme

Host : be.lorryroute.com

Schemes : HTTPS

Consumes

• application/json

Produces

• application/json

Login: Driver Authentication

POST /api/auth/login-driver

Parameters

Type

Name

Schema

Body

payload (required)

LoginDriverPayload

Payload

Name

Description

Schema

password required

Length : 8 - 100 Example : "abcd1234"

string

username required

Length : 6 - 400 Example : "abcd1234"

string

Responses

HTTP Code

Description

Schema

200

OK

Token

400

Bad Request

error

500

Internal Server Error

error

Example HTTP request

Request body

{
"password" : "abcd1234",
"username" : "abcd1234"
}

Example HTTP response

Response 200

{
"token" : "Quibusdam voluptates dolorem quia ut."
}

Login Authentication & Information

POST /api/auth/login

Description

Sign a user in with username and password which will be queried in the users table and return user information.

Parameters

Type

Name

Schema

Body

payload required

LoginPayload

Payload

Name

Description

Schema

organisation_i d required

Example : 5905433815128902000

integer (int64)

password required

Length : 8 - 20 Example : "abcd1234"

string

username required

Minimum length : 3 Example : "jamesbond@gmail.com"

string

Responses

HTTP Code

Description

Schema

200

OK

Login_response

400

Bad Request

error

500

Internal Server Error

error

Example HTTP request

Request body

{
   "organisation_id" : 5905433815128902000,
   "password" : "abcd1234",
   "username" : "jamesbond@gmail.com"
}

Example HTTP response

Response 200

{
   "role" : "Ut explicabo quibusdam quaerat laboriosam aut et.",
   "token" : "Reiciendis et debitis et nam aut.",
   "user_info" : {
     "address_1" : "Atque debitis.",
     "address_2" : "Magnam ratione voluptatum.",
     "city" : "Assumenda aliquid aut ea.",
     "company_name" : "Aspernatur ipsam.",
     "contact_name" : "Illum illo facilis saepe aut ut.",
     "country" : "Est pariatur optio porro.",
     "email" : "Corrupti molestiae non voluptates quis.",
     "fleet_size" : "Et sint quaerat fuga aut minima eum.",
     "org_id" : 3655636715619876400,
     "phone" : "Id placeat aut molestiae in quod officiis.",
     "postcode" : "Laboriosam hic qui enim aut temporibus aut.",
     "username" : "Sed architecto."
} }

Generate API Keys

POST /api/api_keys/generate

Description

Generate an api key that helps access 'generateRoutes'.

Parameters

Type

Name

Schema

Body

payload required

GenerateApiKeyPayLoad

Payload

Name

Description

Schema

email required

Maximal length : 500 Example : "jamesbond@gmail.com"

string (email)

name required

Length : 5 - 100 Example : "exampleName"

string

phone required

Maximal length : 50 Example : "3z4snsxkbc"

string

Responses

HTTP Code

Description

Schema

200

OK

Token

400

Bad Request

error

500

Internal Server Error

No Content

Example HTTP request

Request body

{
   "email" : "jamesbond@gmail.com",
   "name" : "exampleName",
   "phone" : "3z4snsxkbc"
}

Example HTTP response

Response 200

{
   "token" : "Quibusdam voluptates dolorem quia ut."
}

Get API Key Details

GET /api/api_keys/{token}

Description

Get detail of an API key and its user.

Parameters

Type

Name

Description

Schema

Path

token required

token

string

Responses

HTTP Code

Description

Schema

200

OK

Api_key_info

400

Bad Request

error

404

Not Found

error

500

Internal Server Error

error

Example HTTP response

Response 200

{
   "email" : "Nisi et.",
   "generate_routes_number" : 4599346269881404400,
   "name" : "Qui et voluptas sequi et.",
   "phone" : "Quo qui dolor eum qui dolorem alias."
}

Assign Device Token

POST /api/push_token

Description

Assign a device token.

Required security scopes: * api:access

Parameters

Type

Name

Schema

Body

payload
required

PushTokenPayload

Payload

Name

Description

Schema

tokens
required

Example : ""

string

Responses

HTTP Code

Description

Schema

200

OK

PushTokenRespon se

400

Bad Request

error

422

Unprocessable Entity

error

500

Internal Server Error

error

Example HTTP request

Request body

{
   "tokens" : [ "device_token1" ]
}

Example HTTP response

Response 200

{
   "user_id" : 116,
   "driver_id" : 160,
   "tokens" : [ "device_token1" ]
}