Play

The Play API allows an audio file to be played during a call. This is usually used to play a notification on a live call. The Play API also supports the ability to stop an audio file that is being played on the call.

The following actions can be performed with the Play API.

BaseURI: https://api.plivo.com/v1/Account/{auth_id}/Call/{call_uuid}/Play/

Play a Music File

POST https://api.plivo.com/v1/Account/{auth_id}/Call/{call_uuid}/Play/

Arguments

Parameter Description Default
urls (mandatory) A single URL or a list of comma separated URLs linking to an mp3 or wav file.
length (optional) Maximum length in seconds that the audio should be played.
legs (optional) The leg on which the music will be played, can be aleg (i.e., A-leg is the first leg of the call or current call), bleg (i.e., B-leg is the second leg of the call),or both (i.e., both legs of the call). aleg
loop (optional) If set to true, the audio file will play indefinitely. false
mix (optional) If set to true, sounds are mixed with current audio flow. true

Response

HTTP Status Code: 202

{
  "message": "play started",
  "api_id": "07abfd94-58c0-11e1-86da-adf28403fe48"
}

Stop Playing a Music File

DELETE https://api.plivo.com/v1/Account/{auth_id}/Call/{call_uuid}/Play/

Arguments

None

Response

HTTP Status Code: 204