/api/file
/api/file will handle all files for processing in Lasertask. It is a multi functioning end point meaning that the POST and GET types are very important.
Authentication
A standard OAUTH session must be created before a call can be made to this API. A Bearer token (header) is required.
Endpoint
The user profile is retrieved by submitting a POST request on the following Endpoint.
https://[tenant].lasertask.com/api/file/[object]
The [tenant] is the tenant name as used to log in to the Web Application.
The [object] is the object type that should receive the file.
Object Types
[profile-image]
GET: Will retrieve the current avatar image, if set, for currently the authenticated user.
POST: Will save the submitted image as the currently authenticated users profile image. The image parameter must be called ‘avatar’ and the image type must be PNG.
[company-logo]
GET: Will retrieve the current Company Logo, if available.
POST: Will save the submitted image as the Company Logo. If a logo exists it will be replaced without warning. The image parameter must be called ‘company_logo’ and the image type must be PNG.
Example
curl --location --request POST '[tenant].lasertask.local/api/file/profile-image' --header 'Authorization: Bearer [token]' --header 'Content-Type: multipart/form-data;' --form 'avatar=@/C:/Users/Owner/Downloads/1559674671-2023.png'
Data Returned
If a file is successfully processed a success true is returned in a JSON Array.
{ "success": true }