Consumers
First class accounts are given to consumers so they can be linked to multiple agents, and change which agent they are working with on the fly. These consumers can be linked to an agent via the Consumers: Agents service.
Supported Roles
Role | Reads | Writes | Notes |
---|---|---|---|
IDX | No | No | |
Public | No | No | |
VOW | Yes | No | |
Portal | Yes | No | |
Private | No | Yes |
More information about roles may be found here.
Available Services
Consumer Account Info
/<API Version>/consumers/me
HTTP Method | Description | Conditional | Notes |
---|---|---|---|
GET | Returns the account details for the consumer currently accessing the API | No | VOW and Portal roles only |
POST | Returns HTTP 405 (Method Not Allowed) | No | Not implemented |
PUT | Returns HTTP 405 (Method Not Allowed) | No | Not implemented |
DELETE | Returns HTTP 405 (Method Not Allowed) | No | Not implemented |
GET Request
Parameters:
- None
GET Response
{
"D": {
"Success": true,
"Results": [
{
"Id": "20140112234151738955000000",
"ResourceUri": "/v1/consumers/me",
"Name": "Joe Consumer",
"Email": "joe@sparkapi.com",
"LastLoginTimestamp": null,
"ModificationTimestamp": 2014-10-18T16:35:43,
"CreatedTimestamp": 2014-10-18T16:35:43
}
]
}
}
Consumer Account Creation
/<API Version>/consumers
HTTP Method | Description | Conditional | Notes |
---|---|---|---|
GET | Returns HTTP 405 (Method Not Allowed) | No | Not implemented |
POST | Creates a new consumer account | No | Privileged Private roles only. Contact support to request this capability. |
PUT | Returns HTTP 405 (Method Not Allowed) | No | Not implemented |
DELETE | Returns HTTP 405 (Method Not Allowed) | No | Not implemented |
POST Request
Request body:
{
"D": {
"LoginName": "joe@sparkapi.com",
"Password": "12345",
"PasswordConfirmation": "12345",
"Name": "Joe Consumer",
"Email": "joe@sparkapi.com"
}
}
POST Response
The standard success/fail response is returned.
Consumer Account Update
/<API Version>/consumers/<Id>
/<API Version>/consumers/me
HTTP Method | Description | Conditional | Notes |
---|---|---|---|
GET | Returns HTTP 405 (Method Not Allowed) | No | Not implemented |
POST | Returns HTTP 405 (Method Not Allowed) | No | Not implemented |
PUT | Updates an existing consumer record | No | Privileged Private roles only. Contact support to request this capability. |
DELETE | Returns HTTP 405 (Method Not Allowed) | No | Not implemented |
PUT Request
Request body:
{
"D": {
"LoginName": "joe@sparkapi.com",
"Password": "12345",
"PasswordConfirmation": "12345",
"Name": "Joe Consumer",
"Email": "joe@sparkapi.com"
}
}
PUT Response
The standard success/fail response is returned.
Consumers Description
Attribute | Data Type | Writeable | Required | Description |
---|---|---|---|---|
Id |
Character | No | The unique id for the consumer. | |
ResourceUri |
Character | No | The resource URI to the consumer account. | |
Name |
Character | Yes | Yes | The name of the consumer |
Email |
Character | Yes | Yes | The consumer's e-mail address. Note: When updated, the primary contact e-mail for all linked agents will be updated. |
LastLoginTimestamp |
Timestamp | No | No | The last time the consumer logged in to their account. |
ModificationTimestamp |
Timestamp | No | No | The time the consumer record was last updated. |
CreatedTimestamp |
Timestamp | No | No | The time the consumer record was created. |
LoginName |
Character | Yes | Yes | The login name for the consumer. Available for account creation, but never present in the API response. |
Password |
Character | Yes | Yes | The password for the consumer. Available for account creation, but never present in the API response. |
PasswordConfirmation |
Character | Yes | Yes | Must be idential to the Password attribute when creating new consumer accounts |
Expansions
None.