Pause, resume or stop a call recording
const url = 'https://api.siprtc.io/v1/Accounts/AC000000000000000000/Calls/0c9b8a7d-6e5f-4a3b-9c1d-2e3f4a5b6c7d/Recordings/7d1c3b5a-9e8f-4a6b-8c2d-1e0f3a4b5c6d';const options = { method: 'POST', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"PauseBehavior":"skip","Status":"paused"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.siprtc.io/v1/Accounts/AC000000000000000000/Calls/0c9b8a7d-6e5f-4a3b-9c1d-2e3f4a5b6c7d/Recordings/7d1c3b5a-9e8f-4a6b-8c2d-1e0f3a4b5c6d \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "PauseBehavior": "skip", "Status": "paused" }'Changes a recording of a live call: Status=paused pauses it (PauseBehavior skip leaves the pause out of the file, silence fills it with silence), Status=in-progress resumes it, and Status=stopped ends it. Parameters may be sent as JSON, as a form, or in the query string when the body is empty; values are matched without regard to case. A .json suffix on the recording SID is ignored. A call that is not live answers 400 with an empty JSON string as the body; a refusal from the media server is passed on with its own status and body.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Your account Auth ID, or the Auth ID of a sub-account you own
Example
AC000000000000000000Call SID (a UUID) of the live call
Example
0c9b8a7d-6e5f-4a3b-9c1d-2e3f4a5b6c7dRecording SID (a UUID)
Example
7d1c3b5a-9e8f-4a6b-8c2d-1e0f3a4b5c6dRequest Bodyrequired
Section titled “ Request Bodyrequired ”The new recording status
object
With Status=paused only: skip leaves the paused time out of the file, silence records silence for it. Ignored with any other status.
Example
skipRequired. paused pauses the recording, in-progress resumes it, stopped ends it.
Example
pausedobject
With Status=paused only: skip leaves the paused time out of the file, silence records silence for it. Ignored with any other status.
Example
skipRequired. paused pauses the recording, in-progress resumes it, stopped ends it.
Example
pausedResponses
Section titled “ Responses ”The recording’s new status, with sid, call_sid, account_sid and api_version
object
Auth ID of the account.
API version, v1.
SID of the recorded call.
Recording SID (a UUID).
Not currently populated.
On update, the status that was requested (paused, in-progress or stopped); empty when a recording is started.
Not currently populated.
Example
{ "account_sid": "AC000000000000000000", "api_version": "v1", "call_sid": "0c9b8a7d-6e5f-4a3b-9c1d-2e3f4a5b6c7d", "sid": "7d1c3b5a-9e8f-4a6b-8c2d-1e0f3a4b5c6d", "start_time": "", "status": "paused", "uri": ""}Status is missing or invalid (code 20001, "Status is required"), the body could not be read (21210), or the call is not live (body is an empty JSON string)
object
Error code, e.g. 21201 (no To), 21213 (no From), 21205 (no Url), 21211 (invalid To), 21210 (From not verified, or unreadable request), 21219 (To not verified on a trial account), 10001 (account not active), 20001 (invalid parameter), 20009 (no live call to delete). The insufficient-balance error carries 258.
Human-readable explanation.
A link for more information: https:// followed by the host the request was sent to, without its api. prefix.
The HTTP status of the response.
Example
{ "code": 21201, "message": "No 'To' number is specified", "more_info": "https://siprtc.io", "status": 400}Authentication failed: missing or invalid credentials (JSON string from the API gateway)
Example generated
example