License Assignments

The License Assignments API is used to handle the queries for the creation and modification of License allocations to Drivers under the Account, should the Account require it. This API will also handle queries for renewing the License assigned to a Driver.

Fields

Tag Data Type Required Description
accountId Long Auto The id of the Account that owns this record.
activationDate Text Yes Indicates the date when this license assignment was activated.
Note: Format must be in (YYYY-MM-DD)
deactivationDate Text Yes Indicates the date when this license assignment will be deactivated.
Note: Format must be in (YYYY-MM-DD)
id Auto-incremented Long Auto Unique identifier
lastChangedDate Text Auto Auto-generated timestamp of the last change made to this record
Note:
Format is in timestamp and timezone (YYYY-MM-DDTHH:MM:SS.sssZ, e.g: 1970-01-01T00:00:00.000Z)
licenseId Long Yes Id of the License that is assigned to the User.
userId Long Yes Id of the User that this record’s License is assigned to.

Read

API PATH: /api/v2/licenseAssignments
METHOD: GET
PARAMETERS: license-id – Retrieves matching records for a specific License (e.g. user-id=1252160, all Licences by default)
user-id – Retrieves matching records for a specific User (e.g. user-id=1252160, all Users by default)
from-activation-date – Retrieves records with an activation date on or after the date given (e.g. from-date=2016-09-05)
to-activation-date – Retrieves records with an activation date before the date given (e.g. to-date=2016-09-05)
offset – Retrieves matching records after an offset value (e.g. offset=2, zero offset by default)
limit – Retrieves a number of records per page specified by the value (e.g. limit=10, all records by default)
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=license-id – Sort records by their licenseId field in ascending order
sort=-license-id – Sort records by their licenseId field in descending order
sort=user-id – Sort records by their userId field in ascending order
sort=-user-id – Sort records by their userId field in descending order
sort=activation-date – Sort records by their activationDate field in ascending order
sort=-activation-date – Sort records by their activationDate field in descending order
QUERY STRING EXAMPLES: Get the License Assignment with the specified id: api/v2/licenseAssignments/222578
Get all License Assignments of the current Account that were activated on or after 2016-09-05 and before 2016-09-06 : ?from-registration-date=2016-09-05&to-registration-date=2016-09-06
Get two License Assignments of the current Account with an offset of 1 : ?offset=1&limit=2
Get all License Assignments of the current Account sorted by activation date in ascending order: ?sort=activation-date
EXAMPLE RESPONSE:
[
  { 
    "licenseId": 4, 
    "userId": 1252492,
    "activationDate": "2018-06-11", 
    "deactivationDate": "2018-06-10", 
    "accountId" : 1248457, 
    "id" : 222578,
    "lastChangedDate": "2018-06-11T12:00:00.000Z" 
  }
]

API error calls

ERROR MESSAGE POSSIBLE CAUSES
Access Denied. GET requires User Role of USERADMIN or ACCOUNTADMIN.
POST, PUT and DELETE methods are not allowed