PUT /API/V2/CALLAUDIO/{TEMPCALLID}
Attach call audio to a call that is in the process of being uploaded.
After a successful call to PUT /api/v2/call to insert a new call, a {tempcallid} is returned which is to be used with this function.
Once the last audio chunk is uploaded, the whole temporary call including this new audio attachment will be stored.
REQUEST FORMAT
PUT https://api.calln.com/api/v2/callaudio/{tempcallid} Headers: Content-Type: {audio/mpeg or audio/wav} Content-Encoding: gzip Content-Length: {body length in bytes} Content-Range: chunk {chunkNumber}/{totalChunks} Body: <Binary audio data>
{tempcallid} – After a successful call to PUT /api/v2/call to insert a new call, this value returned.
{chunkNumber} – The chunk that is being uploaded.
{totalChunks} – The total amount of chunks. If unknown, it can be set to ‘*’ until the last chunk.
RESULT CODE
200 | OK – All of the audio chunk(s) uploaded successfully and the call is now stored |
---|---|
206 | Partial Content – More audio chunks are needed to complete upload |
400 | Content-Type header is not present |
401 | Unauthorized |
404 | Temporary callid not found |
406 | SSL must be used |
500 | Server Error |
EXAMPLE REQUEST
Example;- PUT https://api.calln.com/api/v2/callaudio/93ee1996c26a407cb5390b42cf0de1dc Headers: Content-Type: audio/mpeg Content-Length: 35784 Content-Range: chunk 15/15 Body: <Binary audio data> Result;- 200 (OK) Body: <empty>
USING CURL
curl "https://api.calln.com/api/v2/callaudio/{tempcallid}" -H "Authorization: Basic username:password | base64" -X PUT --data-binary [email protected]