Users

Invite operator/driver to company

POST invite driver (admin)

Endpoint

POST /api/v1/users/invitation

Parameters

Name Description
user[email] required Email
user[first_name] required First name
user[last_name] required Last name
user[job_position] required Job position (admin)
user[company_id] required Company id (admin)
user[contact_phone_number] required Contact phone number

Request

Route

POST /api/v1/users/invitation

Headers

Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxODU1Iiwic2NwIjoidXNlciIsImF1ZCI6bnVsbCwiaWF0IjoxNzUzMjY2MjI4LCJleHAiOjE3NTU4NTgyMjgsImp0aSI6IjI2NzFkOTMzLWJiZjYtNDk2ZC05OTIxLTJmYmMzMDg3ZGE2ZSJ9.a0z9ZFQ41ouDDw9v-EwWcmZ446qCn91_Z755tnT1n6U
Host: example.org
Cookie: 

Body

{
  "user": {
    "email": "yuk@klein-barrows.test",
    "first_name": "Gaston",
    "last_name": "McGlynn",
    "job_position": "Operator",
    "company_id": 709,
    "contact_phone_number": "07916 607658",
    "role": "driver"
  }
}

Response

Simulated Response

Status

200

Headers

x-frame-options: SAMEORIGIN
x-xss-protection: 0
x-content-type-options: nosniff
x-permitted-cross-domain-policies: none
referrer-policy: strict-origin-when-cross-origin
content-type: application/json; charset=utf-8
vary: Accept, Origin
etag: W/"fcf01d017dea0b07f764a1e9faf93dbf"
cache-control: max-age=0, private, must-revalidate
x-request-id: 97069894-4ace-4fdf-81ee-ba2b01ac7012
x-runtime: 0.064152
content-length: 381

Body

{
  "user": {
    "id": 1856,
    "company": {
      "id": 709,
      "address": "Apt. 966 8468 Dominique Walk, East Elliothaven, AL BE1 0UA",
      "license_number": "3655813215",
      "name": "Mosciski-Rice",
      "state": "verified"
    },
    "contact_phone_number": "07916 607658",
    "email": "yuk@klein-barrows.test",
    "first_name": "Gaston",
    "job_position": "Operator",
    "last_name": "McGlynn",
    "phone_number": null,
    "profile_id": null,
    "role": "operator"
  }
}