Users

Invite operator/driver to company

POST invite operator

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.eyJzdWIiOiIxNzgwIiwic2NwIjoidXNlciIsImF1ZCI6bnVsbCwiaWF0IjoxNzM3NTUxNTkyLCJleHAiOjE3NDAxNDM1OTIsImp0aSI6IjIwOGVlNjg3LWE2NGItNGZkYy05MjFlLThlMzY4NWU3MTI0MSJ9.WJuduz878n0kPOxsHHaV8HD-tl8S7zOQG4V5CRmp7yg
Host: example.org
Cookie: 

Body

{
  "user": {
    "email": "arlene.beer@wyman.example",
    "first_name": "Ursula",
    "last_name": "Gottlieb",
    "contact_phone_number": "07149 534221"
  }
}

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/"a4c4bed0282833cf2ac3c0d98f04e56e"
cache-control: max-age=0, private, must-revalidate
x-request-id: 2df93f81-75d2-4372-84db-ecc30676cec8
x-runtime: 0.114922
content-length: 376

Body

{
  "user": {
    "id": 1781,
    "company": {
      "id": 680,
      "address": "Suite 514 7571 Vincenzo Garden, Biancaville, DE ZH09 6FD",
      "license_number": "2313233203",
      "name": "Schaden-Mraz",
      "state": "verified"
    },
    "contact_phone_number": "07149 534221",
    "email": "arlene.beer@wyman.example",
    "first_name": "Ursula",
    "job_position": null,
    "last_name": "Gottlieb",
    "phone_number": null,
    "profile_id": null,
    "role": "operator"
  }
}