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.eyJzdWIiOiIxODQ4Iiwic2NwIjoidXNlciIsImF1ZCI6bnVsbCwiaWF0IjoxNzU4MDEyNTEyLCJleHAiOjE3NjA2MDQ1MTIsImp0aSI6IjI2Mjg1NTg4LTNmNDctNDRlOS1iNDAzLWM4ZTE2ODhhYjhhMiJ9.ej37uDufVnXP-RNtdUjcfaQwS1AsnuMk9hWEhn8ptm4
Host: example.org
Cookie: 

Body

{
  "user": {
    "email": "mitsue.haley@smith.example",
    "first_name": "Terence",
    "last_name": "Denesik",
    "job_position": "Operator",
    "company_id": 707,
    "contact_phone_number": "07968 788216"
  }
}

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/"9334b5b13a8c62b9ba61d80829e0f3d6"
cache-control: max-age=0, private, must-revalidate
x-request-id: b10779fb-69a0-4088-8539-dd87b60bb171
x-runtime: 0.055833
content-length: 386

Body

{
  "user": {
    "id": 1849,
    "company": {
      "id": 707,
      "address": "99207 Margert Park, Kiyokoburgh, UT R9E 5BE",
      "license_number": "8997854377",
      "name": "Legros, Rosenbaum and Beatty",
      "state": "verified"
    },
    "contact_phone_number": "07968 788216",
    "email": "mitsue.haley@smith.example",
    "first_name": "Terence",
    "job_position": "Operator",
    "last_name": "Denesik",
    "phone_number": null,
    "profile_id": null,
    "role": "operator"
  }
}