Media and TTS

Media management encompasses the collection of media (from a stream or file), the conversion of media to a final format, and the storage of media. It also handles retrieval of media and/or sets of media.

 

URI

  • v1/accounts/{account_id}/media
Property
Description
Validation
Modifiable
name A friendly name required yes
media_type The type of the media [wav|mp3|ogg] yes
Verb
Accepted
Returned
Description
GET   [whistle:{id, name, media_type},...] Fetches a summary of the account's media
PUT ANY ALL Create a new media resource
  • Normal Response Code(s): 200
  • Error Response Code(s): 400, 401, 415, 500, 503, 504

URI

  • v1/accounts/{account_id}/media/{media id}
Property
Description
Validation
Modifiable
name A friendly name required yes
media_type The type of the media [wav|mp3|ogg] yes
streamable Enable streaming of media boolean yes
Verb
Accepted
Returned
Description
GET   ALL Fetch a details of a media resource
POST ANY ALL Update the media metadata
DELETE     Delete the media metadata and binary data
  • Normal Response Code(s): 200, 201
  • Error Response Code(s): 400, 401, 404, 415, 500, 503, 504

URl

  •  v1/accounts/{account_id}/media/{media id}/raw
Verb
Accepted
Returned
Description
GET   BINARY PAYLOAD Fetch the binary data
POST BINARY PAYLOAD   Replace the binary data
  • Normal Response Code(s): 200, 201
  • Error Response Code(s): 400, 401, 404, 415, 500, 503, 504
GET v1/accounts/{account_id}/media X-Auth-Token: abc123
Accept: application/json
 
{
"auth-token":"abc123",
"status":"success",
"data":[
{
"id":"xyz987",
"name":"Media File 1",
}
]
}
200 OK
Content-Type: application/json
PUT v1/accounts/{account_id}/media X-Auth-Token: abc123
Accept: application/json
Content-Type: application/json
{
"data":{
"name":"Media File 1",
"media_type":"wav"
}
}
  201 OK
Location: v1/accounts/{account_id}/media/{media_id}
GET v1/accounts/{account_id}/media/{media_id} X-Auth-Token: abc123
Accept: application/json
 
{
"auth-token":"abc123",
"status":"success",
"data":{
"name":"Media File 1",
"media_type":"wav",
"streamable":"true"
}
}
200 OK
POST v1/accounts/{account_id}/media/{media_id} X-Auth-Token: abc123
Accept: application/json
Content-Type: application/json
{
"data":{
"name":"Media 1",
"media_type":"wav",
"streamable":"true"
}
}
{
"auth-token":"abc123",
"status":"success",
"data":{
"name":"Media 1",
"media_type":"wav",
"streamable":"true"
}
}
}
200 OK
DELETE v1/accounts/{account_id}/media/{media_id} X-Auth-Token: abc123  
{
"auth-token":"abc123",
"status":"success",
"data":[]
}
200 OK
GET /v1/accounts/{account_id}/media/{media_id}/raw X-Auth-Token: abc123
Accept: audio/*
    404 Object Not Found
POST v1/accounts/{account_id}/media/{media_id}/raw X-Auth-Token: abc123
Content-Type: audio/wav
File Binary
{
"auth-token":"abc123",
"status":"success",
"data":[]
}
200 OK
GET v1/accounts/{account_id}/media/{media_id}/raw X-Auth-Token: abc123
Accept: audio/*
  File Binary 200 OK
Content-Type: audio/x-wav
Content-Length: 1234