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.eyJzdWIiOiIxODI0Iiwic2NwIjoidXNlciIsImF1ZCI6bnVsbCwiaWF0IjoxNzQyNDY0OTUyLCJleHAiOjE3NDUwNTY5NTIsImp0aSI6ImVjZDkwMjc2LWFhMTAtNGY5OS1hNmQ5LWE1YTdmMmRkZjBiMiJ9.B-EsFGOQscgNYrfYH1URS5nyV9QRYLsnemDfRahSgcc
Host: example.org
Cookie: 

Body

{
  "user": {
    "email": "cristie@daugherty.example",
    "first_name": "Bobbye",
    "last_name": "Herman",
    "job_position": "Operator",
    "company_id": 693,
    "contact_phone_number": "07978 431794",
    "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/"996d2cc0a8443d80abfcc9a8cede3cbd"
cache-control: max-age=0, private, must-revalidate
x-request-id: f6c032ba-f290-4472-947c-d4d566dae9ff
x-runtime: 0.057312
content-length: 378

Body

{
  "user": {
    "id": 1825,
    "company": {
      "id": 693,
      "address": "Apt. 868 850 Ronald Island, North Dirkport, CO U1K 4ZT",
      "license_number": "9835622308",
      "name": "Hauck-Jacobi",
      "state": "verified"
    },
    "contact_phone_number": "07978 431794",
    "email": "cristie@daugherty.example",
    "first_name": "Bobbye",
    "job_position": "Operator",
    "last_name": "Herman",
    "phone_number": null,
    "profile_id": null,
    "role": "operator"
  }
}