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    /api/admin/dependant/post


Request


The following form-urlencoded content needs to be sent in the request:


Body  

minimum data requirements 

userAccountId

int
the user account id of the employee
tenantId

intthe id of the tenant
tenantName

string
the name of the tenant
hasPersonDetails

boolthe requested use has a person details record
dependents[repeated]



id

the id of the dependant (new set as 0)

typeId

the type id of the dependant

salutationId
the salutation id of the dependant

foreNames


the forenames of the dependant


middleNames

the middlenames of the dependant

surname

the surname of the dependant

secondSurname
the second surname of the dependant


dateOfBirth

the date of birth of the dependant

genderId

the gender id of the dependant

registerDisabled

indicated dependant is registered disabled if set to true

inFullTimeEducation

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

The API Client requires write permission to "User Dependants" and access to the user(s) to successfully to perform post requests (See Admin User Roles for more details).  Only tenants 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/admin/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}} ]}", 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/admin/tenant/executereoprt' \ --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}}]}'