Users
Users are entities with access to created Vehicles.
AddUser
Links an existing User to another "target" User. Linked Users gain access to any associated Vehicle's data and functionality. A User is determined by the "user_key" provided upon creation or obtained via GetUsers.
Request
curl -L -X POST 'https://{DOMAIN}/voyorequest/AddUser
-d 'user_key={USER_KEY}&target_key={TARGET_KEY}'
-H 'Accept: application/json'
-H 'Authorization: Bearer {APIKEY}'
| Parameter | Description |
|---|---|
user_key |
Unique key belonging to the User that will be linked to. |
target_key |
Unique key belonging to the User that will be linked. |
Error Responses
Indicates why the User could not be linked, such as already being linked, unauthorized access, or invalid User key.
HTTP/1.1 400 Bad Request
HTTP/1.1 401 Unauthorized
// Attempting to link two users that are already linked
{ "error":"Target user is already linked!" }
// Both user and target users must be created via CreateUser request
{ "error":"Unauthorized user!" }
Success Responses
User was added successfully.
{ "error":"Success!" }
CreateUser
Creates a Voyomotive user account. The account credentials can be provided to drivers and used to login to VOYOLink or the VOYO app.
Request
Username, password, and email address are required to create an account. Phone number, first name, and last name are optional fields.
curl -L -X POST 'https://{DOMAIN}/voyorequest/CreateUser
-d 'username={USERNAME}&password={PASSWORD}&email={EMAIL}'
-H 'Accept: application/json'
-H 'Authorization: Bearer {APIKEY}'
| Parameter | Description | Requirement | Max Size |
|---|---|---|---|
username |
Unique username. | Required | 100 |
password |
Password that will be used in conjunction with username for login. | Required | 100 |
email |
Valid email address. | Required | 100 |
phone_number |
User's phone number. | Optional | 100 |
first_name |
User's first name. | Optional | 100 |
last_name |
User's last name. | Optional | 100 |
Error Responses
HTTP/1.1 400 Bad Request
/// Error if a required field is missing
{ "error":"Requires username!" }
{ "error":"Requires password!" }
{ "error":"Requires email!" }
/// Error if required field is an empty string
{ "error":"Requires non empty username!" }
{ "error":"Requires non empty password!" }
{ "error":"Requires non empty email!" }
/// Parameters have a 100 character limit
{ "error":"username can not be more than 100 characters!" }
{ "error":"password can not be more than 100 characters!" }
{ "error":"email can not be more than 100 characters!" }
{ "error":"phone_number can not be more than 100 characters!" }
{ "error":"first_name can not be more than 100 characters!" }
{ "error":"last_name can not be more than 100 characters!" }
/// Required fields must not include characaters such as ";"
{ "error":"Requires username without special characters!" }
{ "error":"Requires password without special characters!" }
{ "error":"Requires email without special characters!" }
/// Username must be unique - the following error is returned if attempting to create an account that already exists
{ "error":"Username already exists!" }
Success Responses
On success, user_key will be returned.
This key is an important identifier used to distinguish between Users.
user_key is a requirement for many API requests.
{ "error":"Success!", "user_key":"" }
DeleteUser
Invalidates a created User. This action revokes access to any Vehicles and cannot be undone.
Caution:
1. Links can not be made with a deleted User.
2. Vehicles can not be created with or linked to deleted Users.
3. A deleted User can not create Alerts.
4. A deleted User will no longer be returned by GetUsers.
Request
curl -L -X POST 'https://{DOMAIN}/voyorequest/DeleteUser
-d 'user_key={USER_KEY}'
-H 'Accept: application/json'
-H 'Authorization: Bearer {APIKEY}'
| Parameter | Description |
|---|---|
user_key |
Unique user key belonging to the provided user. |
Error Responses
HTTP/1.1 400 Bad Request
/// Do not have access to this User
{ "error":"Missing user key!" }
{ "error":"Invalid user key!" }
Success Responses
User was deleted successfully.
{ "error":"Success!" }
GetUsers
Get a list of all Users.
Request
Please note that this is a GET request and not a POST request.
curl -L -X GET 'https://{DOMAIN}/voyorequest/GetUsers
-H 'Accept: application/json'
-H 'Authorization: Bearer {APIKEY}'
Example Response
Array "users" can be empty if no User has been created or all previously created Users have been deleted.
{
"error":"Success!", "users":[
{
"first_name":"",
"last_name":"",
"username":"",
"email_address":"",
"user_key":"",
"phone_number":""
}
]
}
RemoveUser
Unlinks one User from another. This operation does not delete the User entirely and can not be used to remove self i.e use two of the same "user_key".
Request
curl -L -X POST 'https://{DOMAIN}/voyorequest/RemoveUser
-d 'user_key={USER_KEY}&target_key={TARGET_KEY}'
-H 'Accept: application/json'
-H 'Authorization: Bearer {APIKEY}'
| Parameter | Description |
|---|---|
user_key |
Unique key belonging to the User that will be unlinked from. |
target_key |
Unique key belonging to the User that will be unlinked. |
Error Responses
HTTP/1.1 400 Bad Request
HTTP/1.1 401 Unauthorized
// Both user and target can not be the same
{ "error":"Can not remove self!" }
// Both user and target users must be created via CreateUser request
{ "error":"Unauthorized user!" }
Success Responses
User was removed successfully.
{ "error":"Success!" }
UpdateUser
Update User account information. Email address, phone number, first name, and last name can be updated all-at-once, one-by-one, or in any combination inbetween. Username and password can not be updated using this request.
Request
curl -L -X POST 'https://{DOMAIN}/voyorequest/UpdateUser
-d 'user_key={USER_KEY}'
-H 'Accept: application/json'
-H 'Authorization: Bearer {APIKEY}'
| Parameter | Description | Requirement | Max Size |
|---|---|---|---|
user_key |
Unique key belonging to the provided User. | Required | 40 |
email |
Valid email address. | Optional | 100 |
phone_number |
User's phone number. | Optional | 100 |
first_name |
User's first name. | Optional | 100 |
last_name |
User's last name. | Optional | 100 |
At least one optional field must be provided.
Error Responses
Indicates why the update could not be processed, such as invalid identifiers or missing update fields.
HTTP/1.1 400 Bad Request
/// User update requesting with nothing to update
{ "error":"Requires something to update!" }
Success Responses
User was updated successfully.
{ "error":"Success!" }