The Subsets endpoint contains a list of sub categories under a specific Terminal. It is used to filter Driver Statuses and Driver Violation results on the portal assigned under a particular Subset of that Terminal. The Driver APIs have a foreign key relationship with Subsets API.
Fields
Tag | Data Type | Required | Description |
accountId | Long | No | The id of the Account that owns this record. |
id | Auto-incremented Long | Auto | Unique Identifier |
isDefault | Boolean | No | Indicates if the Subset is the default subset of the terminal it belongs to or not. Only one Subset can be the default for each terminal at a time. Setting this to true for one Subset will set all other Subsets under the same terminal to false |
name | Text (unlimited) | Yes | The name of the Subset |
terminalId | Long | Yes | The id of the Terminal under which this subset belongs to |
Read
API PATH: | /api/v2/subsets |
METHOD: | GET |
PARAMETERS: | name – Retrieves matching records with the specific name (e.g. name=Sub1, all Subsets by default) terminal-id – Retrieves matching records with the specific terminalId (e.g. terminal-id=1001, all Subsets by default) is-default – Retrieves all default subsets or not (e.g. is-default=true, all Subsets by default) offset – Retrieves matching records after an offset value (e.g. offset=2) limit – Retrieves a number of records per page specified by the value (e.g. limit=10) |
SORTING | sort=id – Sort records by their id field in ascending order (DEFAULT) sort=-id – Sort records by their id field in descending order sort=name – Sort records by their name field in ascending order sort=-name – Sort records by their name field in descending order |
QUERY STRING EXAMPLES: | Get the Subset with the specified id: api/v2/subsets/39 Get two Subsets of the current Account with an offset of 1 : ?offset=1&limit=2 Get all Subsets of the current Account sorted by name alphabetically: ?sort=name |
EXAMPLE RESPONSE: |
[ { "name": "Default Subset", "isDefault": true, "terminalId": 2366, "accountId": 1250300, "id": 765 } ] |
Create
API PATH: | /api/v2/subsets |
METHOD: | POST |
EXAMPLE REQUEST: |
[ { "name": "Default Subset", "isDefault": true, "terminalId": 2366 } ] |
EXAMPLE RESPONSE: |
[ { "name": "Default Subset", "isDefault": true, "terminalId": 2366, "accountId": 1250300, "id": 765 } ] |
Update
API PATH: | /api/v2/subsets |
METHOD: | PUT |
EXAMPLE REQUEST: |
[ { "name": "Default Subset", "isDefault": true, "terminalId": 2366, "id": 765 } ] |
EXAMPLE RESPONSE: |
[ { "name": "Default Subset", "isDefault": true, "terminalId": 2366, "accountId": 1250300, "id": 765 } ] |
Delete
API PATH: | /api/v2/subsets/<id> |
METHOD: | DELETE |
REQUIRED FIELDS: | id |