Alpha Only: This service is subject to change
This service is a work in progress. It is currently subject to change or removal without notice.

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.

  1. Supported Roles
  2. Available Services
    1. Consumer Account Info
    2. Consumer Account Creation
    3. Consumer Account Update
  3. Consumers Description
  4. Expansions
  5. API Explorer

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

URI: /<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

URI: /<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

URI: /<API Version>/consumers/<Id>

URI: /<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.

API Explorer

The API Explorer does not currently support this service.