Engine Users API
- Table of Contents
- Overview
- Attributes
- Get a List of Users
- Get Details on a Single User
- Create a User
- Update a User
- Delete a User
Overview
Engine Users provide authenticated access to various aspects of GreenArrow Engine.
Each user contains separate permissions for the following:
- Injection (can be limited to HTTP submittion, SMTP submission, all of the above, or none of the above)
- API (can be limited to stats-only access, read-only access, full editing privileges, or no access)
- UI (can be limited to stats-only access, read-only access, full editing privileges, or no access)
Attributes
The following are the configurable attributes defined for Engine Users.
user
hash /required
|
Get a List of Users
GET /ga/api/v3/eng/users
Parameters
The following parameters are valid for the above endpoint.
page
integer /optional |
The page number from which to retrieve. Page numbering starts at |
page_token
string /optional |
The |
Examples:
GET /ga/api/v3/eng/users?page={page}
GET /ga/api/v3/eng/users?page_token={page_token}
GET /ga/api/v3/eng/users?name={name}
Response
The response will contain a list of Users in the following format.
users
array of hashes
|
|||||||||||
pagination
hash
|
Example
GET /ga/api/v3/eng/users
HTTP/1.1 200 OK
{
"success": true,
"data": {
"users": [
{
"id": 1,
"email": "[email protected]",
"permissions": {
"injection": "yes",
"api": "yes",
"ui": "yes"
},
"is_disabled": false,
"force_mail_class": null
},
{
"id": 2,
"email": "[email protected]",
"permissions": {
"injection": "yes",
"api": "yes",
"ui": "yes"
},
"is_disabled": false,
"force_mail_class": null
},
{
"id": 3,
"email": "[email protected]",
"permissions": {
"injection": "yes",
"api": "yes",
"ui": "yes"
},
"is_disabled": false,
"force_mail_class": {
"id": 1,
"name": "my_mail_class_one"
}
}
],
"pagination": {
"page": 0,
"per_page": 100,
"num_pages": 1,
"num_records": 3,
"next_page_token": null
}
},
"error_code": null,
"error_messages": null
}
Get Details on a Single User
GET /ga/api/v3/eng/users/{id_or_email}
Parameters
The following parameters are valid for the above endpoint.
id_or_email
string or integer /optional |
The |
Examples:
GET /ga/api/v3/eng/users/123
GET /ga/api/v3/eng/users/[email protected]
Response
The response will contain details on the requested record:
user
hash |
The attributes for this hash are defined in the Attributes section of this document. |
Example
GET /ga/api/v3/eng/users/9
HTTP/1.1 200 OK
{
"success": true,
"data": {
"user": {
"id": 9,
"email": "[email protected]",
"permissions": {
"injection": "yes",
"api": "yes",
"ui": "yes"
},
"is_disabled": false,
"force_mail_class": {
"id": 1,
"name": "my_mail_class_one"
}
}
},
"error_code": null,
"error_messages": null
}
Create a User
POST /ga/api/v3/eng/users
Payload
user
hash /required |
The content of this hash is described in the Attributes section of this page. The data may contain a mixture of required and optional fields. Do not specify read-only fields. |
Response
The response will include a user
key containing the full User record as
defined in the User Attributes.
Example
POST /ga/api/v3/eng/users
{
"user": {
"email": "[email protected]",
"password": "greenarrow",
"permissions": {
"injection": "smtp-only",
"api": "stats-only",
"ui": "read-only"
},
"is_disabled": true,
"force_mail_class": {
"name": "my_mail_class_one"
}
}
}
HTTP/1.1 200 OK
{
"success": true,
"data": {
"user": {
"id": 16,
"email": "[email protected]",
"permissions": {
"injection": "smtp-only",
"api": "stats-only",
"ui": "read-only"
},
"is_disabled": true,
"force_mail_class": {
"id": 1,
"name": "my_mail_class_one"
}
}
},
"error_code": null,
"error_messages": null
}
Update a User
PUT /ga/api/v3/eng/users/{id}
Payload
user
hash /required |
The content of this hash is described in the Attributes section of this page. The data may contain a mixture of required and optional fields. Do not specify read-only fields. |
Response
The response will include a user
key containing the full user
record as defined in the User Attributes.
Example
PUT /ga/api/v3/eng/users/23
{
"user": {
"email": "[email protected]"
}
}
HTTP/1.1 200 OK
{
"success": true,
"data": {
"user": {
"id": 23,
"email": "[email protected]",
"permissions": {
"injection": "yes",
"api": "yes",
"ui": "yes"
},
"is_disabled": false,
"force_mail_class": null
}
},
"error_code": null,
"error_messages": null
}
Delete a User
DELETE /ga/api/v3/eng/users/{id}
Response
The response is a standard success or error response.
Example
DELETE /ga/api/v3/eng/users/26
HTTP/1.1 200 OK
{
"success": true,
"data": {
},
"error_code": null,
"error_messages": null
}