Users

Invite operator/driver to company

POST invite operator (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.eyJzdWIiOiIxODE3Iiwic2NwIjoidXNlciIsImF1ZCI6bnVsbCwiaWF0IjoxNzQyNDY0OTUyLCJleHAiOjE3NDUwNTY5NTIsImp0aSI6IjkyOTMwOTFiLWExYjYtNGY4NS05MmZjLTQ3NWEzMzhiMDI5OCJ9._BwkFz2IkRyG3MHuBBzvw7uSVT0B4lvd26OC6flaqZg
Host: example.org
Cookie: 

Body

{
  "user": {
    "email": "harvey.von@sanford-smitham.test",
    "first_name": "Emilio",
    "last_name": "Sauer",
    "job_position": "Operator",
    "company_id": 691,
    "contact_phone_number": "07135 423974"
  }
}

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/"34331107cd93a46aa5707e2ba5887497"
cache-control: max-age=0, private, must-revalidate
x-request-id: 5143c97f-9c62-444f-9931-f22bbeca8111
x-runtime: 0.060144
content-length: 386

Body

{
  "user": {
    "id": 1818,
    "company": {
      "id": 691,
      "address": "336 Jerry Meadows, McGlynnville, CT TV3N 4BB",
      "license_number": "2977179406",
      "name": "Marks, Daniel and Bernier",
      "state": "verified"
    },
    "contact_phone_number": "07135 423974",
    "email": "harvey.von@sanford-smitham.test",
    "first_name": "Emilio",
    "job_position": "Operator",
    "last_name": "Sauer",
    "phone_number": null,
    "profile_id": null,
    "role": "operator"
  }
}