All API end points are protected and you will need a bearer token to send to the end point before you will be permitted access. To obtain a bearer token you will need to send a request to the following end point:
POST
Request
The following form-urlencoded content needs to be sent in the request:
Body
minimum data requirements
IMPORTANT - if no dependants are sent in the request (one or many) it will be treated as a remove all dependants request.
userAccountId | int | the user account id of the employee | |
tenantId | int | the id of the tenant | |
tenantName | string | the name of the tenant | |
hasPersonDetails | bool | the requested user has a person details record | |
dependent | |||
id | int | the id of the dependant (new set as 0 for a new dependant) | |
typeId | nullable int | the type id of the dependant | |
salutationId | nullable int | the salutation id of the dependant | |
foreNames | string | the forenames of the dependant | |
middleNames | string | the middlenames of the dependant | |
surname | string | the surname of the dependant | |
secondSurname | string | the second surname of the dependant | |
dateOfBirth | Date | the date of birth of the dependant. Example of date format "2009-04-08T00:00:00" | |
genderId | nullable int | the gender id of the dependant | |
registeredDisabled | bool | indicated dependant is registered disabled if set to true | |
inFullTimeEducation | bool | indicates dependant in full time education if set to true |
See How to create API Clients to see how to obtain API Client IDs and secrets
Permissions
Only tenants/users that the API client has access to will be returned.
C# Example:
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://{platform API url}/api/dependant/post");
var content = new StringContent("{\"userAccountId\": \"{userAccountId}\",\"tenantId\": \"{tenantId}\",\"tenantName\": \"{tenantName}\", \"dependants\": [ { \"id\": {id},\"typeId\": {typeId},\"salutationId\": {salutationId},\"forenames\": \"{foreNames}\", \"middelNames\": {middleNames}, \"surname\": \"{surName}", \"dateOfBirth\": \"{dateOfBirth}", \"genderId\": {genderId}, \"registeredDisabled\":{registeredDisabled}, \"inFullTimeEducation\": {inFullTimeEducation},\"requireDocument\":{requireDocument },\"isDeleted\":{isDeleted}, \"allowDelete\":{allowDelete}, \"requireDeleteDocument\":{requireDeleteDocument} ]}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
cURL Example
curl --location 'https://{platform API url}/api/dependant/post' \ --header 'Content-Type: application/json' \ --data-{"userAccountId": "{userAccountId}", "tenantId": "{tenantId}","tenantName":"{tenantName}","dependants": [{ "id":{id}, "typeId": {typeId}, "salutationId": {salutationId}, "forenames": "{foreNames}", "middlenames": "{middleNames}","surname": "{surname}","dateOfBirth": "{dateOfBirth}", "genderId": {genderId}, "registeredDisabled": {registeredDisabled},"inFullTimeEducation": {inFullTimeEducation}, "requireDocument" : {requireDocument} , "isDeleted" : {isDeleted}, "allowDelete" : {allowDelete}, "requireDeleteDocument" : {requireDeleteDocument }]}'