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.eyJzdWIiOiIxNzkzIiwic2NwIjoidXNlciIsImF1ZCI6bnVsbCwiaWF0IjoxNzM3NTUxNTkyLCJleHAiOjE3NDAxNDM1OTIsImp0aSI6IjVlMDYzNmNhLWYxY2EtNGY2Yi1hMDYwLWYzYWRmNzQ2NmY4ZSJ9.dd5XBGRlXIVZ-mOdYNxcMcJKtpB4bYt0-1zP7plgHAo
Host: example.org
Cookie: 

Body

{
  "user": {
    "email": "selina@howe.test",
    "first_name": "Tamica",
    "last_name": "Nolan",
    "job_position": "Operator",
    "company_id": 684,
    "contact_phone_number": "07335 050215",
    "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/"679d867fbf11d709eeca38ece262249c"
cache-control: max-age=0, private, must-revalidate
x-request-id: 7427d22b-6085-4126-9584-a6d9a48f985a
x-runtime: 0.058231
content-length: 360

Body

{
  "user": {
    "id": 1794,
    "company": {
      "id": 684,
      "address": "1863 Harvey Cape, Lake Tedshire, AZ E7 5BB",
      "license_number": "5025066160",
      "name": "Ritchie and Sons",
      "state": "verified"
    },
    "contact_phone_number": "07335 050215",
    "email": "selina@howe.test",
    "first_name": "Tamica",
    "job_position": "Operator",
    "last_name": "Nolan",
    "phone_number": null,
    "profile_id": null,
    "role": "operator"
  }
}