This request is used to upload a picture of the employee. Supported formats are JPEG, PNG, WebP, TIFF, GIF and SVG.
The picture must be a photograph of one person. It is checked automatically on Telecom X's own servers - it is not sent to anyone else - and refused with 422 (check is one_person, see Errors) when it:
reason is not_photo),no_face) or more than one face (people), orchild).
The reason tells the client why, and the message says it in words, e.g. “No face was found in the picture”. Without a known reason the message is “The picture must show one person”.
An accepted picture is cropped to a square around face and neck, its background is replaced with light grey, and it is stored as a JPEG of at most 1024×1024 pixels.
Employees that are not a person may have any picture: employees with access level NO_LOGIN whose master product gives extension access but no Communicator, recording or SIP phone access (e.g. a queue), and employees whose master product has “api” or “test” in its name. A photograph with one face is still cropped the same way.
If the check cannot be made, the picture is stored as uploaded.
The upload must be performed as a multipart/form-data post request.
| URL | https://api.telecomx.dk/employee/EMPLOYEE_ID/picture | |
|---|---|---|
| Method | POST | |
| Access level | PERSONAL or VIEWER 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 |
https://api.telecomx.dk/employee/1234567890ABCDEF1234578/picture
| Json object | ||
|---|---|---|
| success | Boolean | True on success. |
| picture | Id | Id of the new picture. |
| pictureUrl | String | Signed download URL of the picture (JPEG), when the user may download it - see Signed file URLs. |
{ success: true, picture: '123456789012345678901234 }
| Error code | Message | Description |
|---|---|---|
| 400 | bad_request | Id not found in request URI |
| 403 | access_denied | Insufficient access level |
| 404 | not_found | Employee not found |
| 422 | picture | The picture must show one person - check is one_person, reason is not_photo, no_face, people or child |
| 422 | picture | Invalid image file - check is invalid_image |
| 422 | picture | No file uploaded - check is no_file |
| 500 | internal_error | <unspecified> |