api:employee:picture-upload
Table of Contents
API : Employee Upload Picture
Introduction
This request is used to upload a picture of the employee. Supported formats are PNG and JPG.
The picture will be stored as a 225×300 pixels PNG, if the uploaded picture does not conform to this size, it will be scaled and cropped to fit the size.
The upload must be performed as a multipart/form-data post request.
Request
| URL | https://api.telecomx.dk/employee/EMPLOYEE_ID/picture | |
|---|---|---|
| Method | POST | |
| Access level | PERSONAL if uploading own picture MANAGER or OWNER if user belongs to the customer. RESELLER if customer belongs to the reseller and employee belongs to the customer. ADMIN. |
|
| Params | EMPLOYEE_ID | Id of the employee to upload the picture for |
| Body | file | Binary image data |
Request example
https://api.telecomx.dk/employee/1234567890ABCDEF1234578/picture
Response
| Json object | ||
|---|---|---|
| success | Boolean | True on success. |
Example
{ success: true, picture: '123456789012345678901234 }
Errors
| Error code | Message | Description |
|---|---|---|
| 400 | bad_request | Id not found in request URI |
| 404 | not_found | Employee not found |
| 404 | file | The file was missing or invalid |
| 422 | file | Filetype must be PNG or JPG |
| 403 | access_denied | Insufficient access level |
| 500 | internal_error | Failed to scale/crop image |
| 500 | internal_error | <unspecified> |
api/employee/picture-upload.txt · Last modified: 2020/06/03 13:03 by Per Møller