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/delete-with-file


Request


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


Body  


mandatory data requirements 

dependant





userAccountId
intthe id of user

id

int
the id of the dependant

typeId

int
the type id of the dependant within the tenant

dependantDocuments




fileGuidguildfile guid




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:


vvar client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://{platform API url}/api/dependant/delete-with-file");
request.Headers.Add("Authorization""••••••");
var content = new StringContent("{\r\n\"userAccountId\": {userAccountId},\r\n\"id\" : {id}, \r\n\"typeId\" : {typeId},\r\n\"requireDeleteDocument\" : {requireDeleteDocument},\r\n         \"dependantDocuments\" : [\r\n\"fileGuid\" : \"fileGuid\"\r\n }]\r\n                                     \r\n}\r\n\r\n"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}' \--header 'Content-Type: application/json' \--header 'Authorization: ••••••' \--data '{ "userAccountId"{userAccountId},               "id" : {id},"typeId" : {typeId}, "requireDeleteDocument" : {requireDeleteDocument
}, "dependantDocuments" : [{ "fileGuid" : "{fileGUid}"}]}