Chilkat Online Tools

Swift3 / Plivo REST API / Stop play audio to a member

Back to Collection Items

func chilkatTest() {
    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    let http = CkoHttp()!
    var success: Bool

    http.basicAuth = true
    http.login = "{{auth_id}}"
    http.password = "password"

    var resp: CkoHttpResponse? = http.quickRequest("DELETE", url: "https://api.plivo.com/v1/Account/<auth_id>/Conference/{conference_name}/Member/{member_id}/Play/")
    if http.lastMethodSuccess == false {
        print("\(http.lastErrorText!)")
        return
    }

    print("\(resp!.statusCode.intValue)")
    print("\(resp!.bodyStr!)")
    resp = nil

}

Curl Command

curl -X DELETE
	-u '{{auth_id}}:password'
https://api.plivo.com/v1/Account/<auth_id>/Conference/{conference_name}/Member/{member_id}/Play/

Postman Collection Item JSON

{
  "name": "Stop play audio to a member",
  "request": {
    "method": "DELETE",
    "header": [
    ],
    "url": {
      "raw": "https://api.plivo.com/v1/Account/{{auth_id}}/Conference/{conference_name}/Member/{member_id}/Play/",
      "protocol": "https",
      "host": [
        "api",
        "plivo",
        "com"
      ],
      "path": [
        "v1",
        "Account",
        "{{auth_id}}",
        "Conference",
        "{conference_name}",
        "Member",
        "{member_id}",
        "Play",
        ""
      ]
    },
    "description": "This API will stop the file which is being played to a member initiated by the Play API\n\nMore information can be found [here](https://www.plivo.com/docs/voice/api/conference/member#stop-playing-audio-to-a-member)"
  },
  "response": [
    {
      "name": "Stop play audio to a member",
      "originalRequest": {
        "method": "DELETE",
        "header": [
        ],
        "url": {
          "raw": "https://api.plivo.com/v1/Account/{{auth_id}}/Conference/{conference_name}/Member/{member_id}/Play/",
          "protocol": "https",
          "host": [
            "api",
            "plivo",
            "com"
          ],
          "path": [
            "v1",
            "Account",
            "{{auth_id}}",
            "Conference",
            "{conference_name}",
            "Member",
            "{member_id}",
            "Play",
            ""
          ]
        }
      },
      "code": 204,
      "_postman_previewlanguage": "json",
      "header": [
      ],
      "cookie": [
      ],
      "body": "{\n    \"message\": \"playing in conference stopped\",\n    \"member_id\": \"10\",\n    \"api_id\": \"2867b6e2-58c3-11e1-86da-adf28403fe48\"\n}"
    }
  ]
}