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.eyJzdWIiOiIxODU1Iiwic2NwIjoidXNlciIsImF1ZCI6bnVsbCwiaWF0IjoxNzU4MDEyNTEzLCJleHAiOjE3NjA2MDQ1MTMsImp0aSI6IjNjMmM1NDM1LTYwMmQtNGM0Ny1iNGExLTk2NGZjN2ZjZmM0NCJ9.cgroTb6H5LQ8vmZMTk-_p0FQOCaHDxLljw2ni9Q2sNM
Host: example.org
Cookie: 

Body

{
  "user": {
    "email": "osvaldo_herzog@hagenes.test",
    "first_name": "Allen",
    "last_name": "Balistreri",
    "job_position": "Operator",
    "company_id": 709,
    "contact_phone_number": "07763 646820",
    "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/"4a2bd20908deb274f9de946ad432d2e9"
cache-control: max-age=0, private, must-revalidate
x-request-id: 17130220-90da-4589-b11d-e832b0db282b
x-runtime: 0.061993
content-length: 368

Body

{
  "user": {
    "id": 1856,
    "company": {
      "id": 709,
      "address": "949 Grant Plain, Adamsbury, WI Y87 3JN",
      "license_number": "9080722437",
      "name": "Skiles-Becker",
      "state": "verified"
    },
    "contact_phone_number": "07763 646820",
    "email": "osvaldo_herzog@hagenes.test",
    "first_name": "Allen",
    "job_position": "Operator",
    "last_name": "Balistreri",
    "phone_number": null,
    "profile_id": null,
    "role": "operator"
  }
}