Many responses hold the id of a file on the image, audio or document servers - an employee picture, an audio prompt, a call recording, a voicemail, a stored document. Next to such an id the response holds a signed download URL for the file. The URL works on its own, without the user's token, so it can go straight into <img src>, <audio src> or a link.
The URL property is named after the id property with Url added, and stands next to it in the same object:
| Id property | URL property |
|---|---|
| picture | pictureUrl |
| startAudio | startAudioUrl |
| fileId | fileIdUrl |
| _id | _idUrl |
| audio[].id | audio[].idUrl |
An array of ids gets an array of URLs in the same order. The id property itself is unchanged.
The URL property is left out when:
imageUrl on countries, which is left as it is{ _id: '64e9d2c5c5d9b6a8f0f1d101', name: 'Ole Hansen', picture: '64e9d2c5c5d9b6a8f0f1da01', pictureUrl: 'https://image.telecomx.dk/64e9d2c5c5d9b6a8f0f1da01.jpeg?exp=1794700800&sig=m7GDjWx7ahgXwQf6RF3gHzLLQylxjwy6u57uRT0fG2o' }
https://image.telecomx.dk/<ID>.jpeg?exp=<EXP>&sig=<SIG> https://audio.telecomx.dk/<ID>.mp3?exp=<EXP>&sig=<SIG> https://doc.telecomx.dk/<ID>?exp=<EXP>&sig=<SIG>
Requests made to api.powernet.tv get image.powernet.tv and audio.powernet.tv URLs.
| Part | Description |
|---|---|
| ID | Id of the file. |
| EXP | When the URL expires, Unix time in whole seconds. |
| SIG | Signature of the id and the expiry. |
Only the id and the expiry are signed, so the rest of the URL may be changed:
.png or .webp instead of .jpeg, and the image parameters such as width and height, e.g. …&width=100&height=100.wav - see the formats on PBX audio gethttps://audio.telecomx.dk/<ID>/Message.mp3?exp=<EXP>&sig=<SIG>. This form works on all three servers - /<ID>.mp3/Message.mp3 does not work on the audio server
A URL whose id, exp or sig has been changed is refused with 403 Access Denied, and so is a URL that has expired.
| Files | Valid for | The same URL is given within |
|---|---|---|
| Images | 6 to 7 days | a calendar day (UTC) |
| Audio and documents | 5 hours 45 minutes to 6 hours | a quarter of an hour |
The URL stays the same for a while, so a browser can cache the file, and a list of pictures is not downloaded again on every response. When a URL has expired, read the object from the API again to get a new one. A URL keeps working until it expires, also after the user has logged off.
The URL properties are never stored. An object sent back in a create or update request may still hold them - they are ignored.
URLs with ?token=<TOKEN> work as before. Properties that already hold such URLs, e.g. the playback links of PBX audio with links=true, are unchanged.
| Section | URL properties |
|---|---|
| Employees | pictureUrl, voicemail.defaultGreetingUrl, voicemail.offWorkGreetingUrl, voicemail.holidayGreetingUrl |
| PBX phonebook | pictureUrl |
| PBX app employees | pictureUrl |
| PBX calls | handler.caller.employee.pictureUrl, handler.callee.employee.pictureUrl |
| PBX audio, Text to speech (mode PBX_AUDIO) | _idUrl |
| Music on hold | audio[].idUrl |
| PBX voicemail | _idUrl |
| Call recordings, Recording consent records | _idUrl |
| PBX CDR | recording[]._idUrl |
| PBX dialplan items, PBX settings | startAudioUrl, broadcastAudioUrl, timeoutAudioUrl, invalidAudioUrl, menu[].audioUrl, member.announceUrl, callback.messageUrl, callback.offerMessageUrl, announcements[].messageUrl, consentGivenMessageUrl, consentRejectedMessageUrl and the recording.*MessageUrl properties of the settings |
| PBX backup | fileIdUrl when a backup is stored |
| Files | fileIdUrl |
| ZeroTier | employeePictureUrl |
| Human tasks | _idUrl on images and files |