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:
This endpoint allows you to upload a file (streamed content) to the tenant's library.
POST
Form Params
minimum data requirements
accessorIds | string | (semicolon) separated list If accessorType 0 , use a comma separated list of tenantIds If accessorType 1, use a comma separated list of roles If accessorType 2, use a comma separated list of users |
tenantId | string | The tenant id that the user belongs to |
category | string | The tenant's category to upload into (e.g. "upload") upload library contract payslip image webfont securefiletransfer notefile policytaskfile schedulereportresult scheduleuploadfile personaldevelopmenttrainingdocument scheduledownloadfile reportcomparisonfile securefiletransferbackup schedulefdfmergepdffile benefitreimbursementreceipt retaineduploadcopy dependantdocument |
accessorType | string | set this to "0" for tenant, 1 for "roles" and "2" for User |
duplicateFileSuffix | string | e.g. " - Copy" |
fileType | string | UserUpload = "1", Library = " 2", Contract = " 3", Payslip = " 4", Image = " 5", Webfont = " 6", Sicknote = " 7", StaticDataUpload = "8", ExpenseClaimItemReceipt = " 9", SecureFileTransfer = " 10", NoteUserFileUpload = " 12", GadRecordFileUpload = " 13", NoteTenantFileUpload = "14", PolicyTaskFileUpload = " 15", ScheduleReport = " 16", PersonalDevelopmentTrainingDocument = "17", UserAvatar = " 18", DataTransferUpload = "19", CemClaimItemReceipt = " 20", HolidayAttachment = " 21", DataTransferDownload = " 22", DataComparisonReportUpload = " 23,", SecureFileTransferBackup = " 24", PDFMergeGenerated = " 25", BenefitReimbursementReceipt =" 26", UploadRetainedCopy = " 27 ", |
See How to create API Clients to see how to obtain API Client IDs and secrets
Authorization
The following authorization header is required. The authorisation header should be set to a 'Bearer Token' type
Token |
Response
fileGuid | GUID | A unique reference to the file |
Permissions
The API Client requires at least write permissions to Tenant users document library to successfully submit new files (See Admin User Roles for more details). Only tenants that the API client has access to will be returned.
var request = new HttpRequestMessage(HttpMethod.Post, "https://{platform API url}/api/file/upload/store");
var content = new MultipartFormDataContent(); content.Add(new StringContent("{tenantId}"), "tenantId"); content.Add(new StringContent("{category}"), "category"); content.Add(new StringContent("{accessorType}"), "accessorType"); content.Add(new StringContent("{duplicateFileSuffix}), "duplicateFileSuffix"); content.Add(new StringContent("{fileType}"), "fileType") content.Add(new StringContent("{accesserIds}"), "accesserIds"); content.Add(new StreamContent(File.OpenRead("{filePath}")), "", "{filePath}"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync());
cURL Example
url --location 'https://{platform API url}/api/file/upload/store' \--header 'Authorization: ••••••' \--form 'tenantId="{tenantId}
"' \--form 'category="{category}
"' \--form 'accessorType="{accessorType}
"' \--form 'duplicateFileSuffix="{duplicateFileSuffix}"' \--form 'fileType="{fileType}"' \--form 'accesserIds="{accesserIds}"' \--form '=@"{filePath}"'