VB.NET / Plivo REST API / Stop currently active recording
Back to Collection Items
' This example assumes the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.
Dim http As New Chilkat.Http
Dim success As Boolean
http.BasicAuth = True
http.Login = "{{auth_id}}"
http.Password = "password"
' Use this online tool to generate code from sample JSON: Generate Code to Create JSON
' The following JSON is sent in the request body.
' {
' "URL": "http://s3.amazonaws.com/recordings_2013/48dfaf60-3b2a-11e3.mp3"
' }
Dim json As New Chilkat.JsonObject
json.UpdateString("URL","http://s3.amazonaws.com/recordings_2013/48dfaf60-3b2a-11e3.mp3")
Dim sbRequestBody As New Chilkat.StringBuilder
json.EmitSb(sbRequestBody)
Dim resp As Chilkat.HttpResponse = http.PTextSb("DELETE","https://api.plivo.com/v1/Account/<auth_id>/Call/{call_uuid}/Record/",sbRequestBody,"utf-8","application/json",False,False)
If (http.LastMethodSuccess = False) Then
Debug.WriteLine(http.LastErrorText)
Exit Sub
End If
Dim respStatusCode As Integer = resp.StatusCode
Debug.WriteLine("Response Status Code = " & respStatusCode)
If (respStatusCode <> 204) Then
Debug.WriteLine("Response Header:")
Debug.WriteLine(resp.Header)
Debug.WriteLine("Response Body:")
Debug.WriteLine(resp.BodyStr)
Debug.WriteLine("Failed.")
Exit Sub
End If
Debug.WriteLine("Success.")
Curl Command
curl -X DELETE
-u '{{auth_id}}:password'
-d '{
"URL":"http://s3.amazonaws.com/recordings_2013/48dfaf60-3b2a-11e3.mp3"
}'
https://api.plivo.com/v1/Account/<auth_id>/Call/{call_uuid}/Record/
Postman Collection Item JSON
{
"name": "Stop currently active recording",
"request": {
"method": "DELETE",
"header": [
],
"body": {
"mode": "raw",
"raw": "{\n \"URL\":\"http://s3.amazonaws.com/recordings_2013/48dfaf60-3b2a-11e3.mp3\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://api.plivo.com/v1/Account/{{auth_id}}/Call/{call_uuid}/Record/",
"protocol": "https",
"host": [
"api",
"plivo",
"com"
],
"path": [
"v1",
"Account",
"{{auth_id}}",
"Call",
"{call_uuid}",
"Record",
""
]
}
},
"response": [
{
"name": "Stop currently active recording",
"originalRequest": {
"method": "DELETE",
"header": [
],
"body": {
"mode": "raw",
"raw": "{\n \"URL\":\"http://s3.amazonaws.com/recordings_2013/48dfaf60-3b2a-11e3.mp3\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://api.plivo.com/v1/Account/{{auth_id}}/Call/{call_uuid}/Record/",
"protocol": "https",
"host": [
"api",
"plivo",
"com"
],
"path": [
"v1",
"Account",
"{{auth_id}}",
"Call",
"{call_uuid}",
"Record",
""
]
}
},
"code": 204,
"_postman_previewlanguage": "Text",
"header": [
],
"cookie": [
],
"body": ""
}
]
}