Accounts Model
Create Pollable Account
This method allows for the creation of a new Pollable
account. Creation of the account requires a POST
without a path parameter. The user will be identified by the jwt passed in the request.
POST /accounts HTTP/1.1
Host: example.com
Accept: application/json
Authorization: Bearer "eyCJhYCQ...
Request Body:
{
"attributes": {
"key": "value"
}
}
Response:
{
"id": 1,
"object": "account",
"attributes": {
"key": "value"
},
"links": {
"self": "/accounts"
}
}
Retrieving an Account
To obtain an already created account use a GET
request.
GET /accounts HTTP/1.1
Host: example.com
Accept: application/json
Authorization: Bearer "eyCJhYCQ...
Response:
{
"id": 1,
"object": "account",
"attributes": {
"key": "value"
},
"links": {
"self": "/accounts"
}
}
Modifying an Account
To change an already created account use a PUT
request.
PUT /accounts HTTP/1.1
Host: example.com
Accept: application/json
Authorization: Bearer "eyCJhYCQ...
Request Body:
{
"attributes": {
"key": "value"
}
}
Response:
{
"id": 1,
"object": "account",
"attributes": {
"key": "value"
},
"links": {
"self": "/accounts"
}
}
Query Parameters
The following request parameters are used to define account attributes.
Request Attribute | Type | Description | Required |
---|---|---|---|
attributes | Object | Account attributes in the form of an object | No |