{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","params":[],"results":{"codes":[]},"settings":""},"next":{"description":"","pages":[]},"title":"Media","type":"basic","slug":"account-media","excerpt":"","body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"Note: This API is for users with Account Owner scope access token. Users with Extension User scope token should invoke the Extension level Media API with the following definition:\\n\\nhttps://api.phone.com/v4/accounts/:account_id/extensions/:extension_id/media\"\n}\n[/block]\nYour Phone.com account has two kinds of media that can be used in various ways: Hold Music and Greetings.\n\nHold Music can be used in [routes](doc:account-routes), [queues](doc:account-queues), and anywhere the caller might be placed on hold.  Your account has access to a set of standard hold music options, and optionally another set of premium hold music options.  You can also upload your own hold music, subject to copyright limitations.\n\nGreetings are verbal messages that can be played in various places to provide the caller with important information.  For example, greetings are used when a caller first enters a [menu](doc:account-menus) or if they enter an invalid option.  You also might use a greeting to alert the user to the fact that their call is being recorded.\n\n## Supported Services\n* [List Media](doc:list-account-media) \n* [List Media Usage](doc:list-account-media-usage) \n* [Get Media](doc:get-account-media) \n* [Create Media](doc:create-account-media) \n* [Replace Media](doc:replace-account-media) \n* [Delete Media](doc:delete-account-media) \n\n## Summary Object\nThe Recording Summary Object is used to briefly represent a media recording. It can be seen in several places throughout this API. Here are the properties:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"`id`\",\n    \"0-1\": \"Integer\",\n    \"0-2\": \"Recording ID. Read-only.\",\n    \"1-0\": \"`voip_id`\",\n    \"1-1\": \"Integer\",\n    \"1-2\": \"Account ID\",\n    \"2-0\": \"'name'\",\n    \"2-1\": \"String\",\n    \"2-2\": \"Name of recording\",\n    \"3-0\": \"'type'\",\n    \"3-2\": \"Can be `hold_music` or `greeting`. Indicates the purpose of this recording and where it can be used.\",\n    \"3-1\": \"String\",\n    \"4-0\": \"'created_at'\",\n    \"4-1\": \"String\",\n    \"4-2\": \"Timestamp of media creation time\",\n    \"5-0\": \"'created_at_epoch'\",\n    \"5-1\": \"Integer\",\n    \"5-2\": \"Timestamp in unix format\",\n    \"6-0\": \"'duration'\",\n    \"6-1\": \"Integer\",\n    \"6-2\": \"Duration of greeting\",\n    \"7-0\": \"'notes'\",\n    \"7-1\": \"String\",\n    \"7-2\": \"Notes of greeting\",\n    \"8-0\": \"'expires_at'\",\n    \"8-1\": \"Integer\",\n    \"8-2\": \"Time when greeting is removed from account\",\n    \"9-0\": \"'origin'\",\n    \"9-1\": \"String\",\n    \"9-2\": \"'file' or 'tts'\",\n    \"10-0\": \"'is_temporary'\",\n    \"10-1\": \"Boolean\",\n    \"10-2\": \"true or false.  If set to true, will be removed from account at time 'expires_at'\",\n    \"11-0\": \"'randomized'\",\n    \"11-1\": \"String\",\n    \"11-2\": \"Y or N.  Start the greeting from random location, instead of the beginning\",\n    \"12-0\": \"'filename'\",\n    \"12-1\": \"String\",\n    \"12-2\": \"Name of file to be uploaded, when 'origin' is set to 'file'\"\n  },\n  \"cols\": 3,\n  \"rows\": 13\n}\n[/block]\nHere is an example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"id\\\": 629061,\\n    \\\"voip_id\\\": 349034,\\n    \\\"name\\\": \\\"Main Menu Hold Music\\\",\\n    \\\"type\\\": \\\"hold_music\\\",\\n    \\\"created_at\\\": \\\"2017-03-17T07:32:31-07:00\\\",\\n    \\\"created_at_epoch\\\": 1489761151,\\n    \\\"duration\\\": null,\\n    \\\"notes\\\": null,\\n    \\\"expires_at\\\": null,\\n    \\\"origin\\\": \\\"file\\\",\\n    \\\"is_temporary\\\": false,\\n    \\\"randomized\\\": \\\"N\\\",\\n    \\\"filename\\\": \\\"test.mp3\\\",\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n## Full Object\nThe Full Recording Object and the Summary Recording Object are the same.\n\n\n## Lookup Object\nThe Recording Lookup Object is used to link to a media recording from another object. This is used, for example, when defining actions for [routes](doc:account-routes).  Only *one* of the following properties need to be included. If multiple are specified, then *all* properties must match one of your recordings.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"`id`\",\n    \"0-1\": \"ID\",\n    \"1-0\": \"`name`\",\n    \"1-1\": \"Name\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\nHere are some examples:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"media: {\\n    \\\"id\\\": 772352\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"media: {\\n    \\\"name\\\": \\\"Chickens laughing\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nInstead of inputting an object, you can also use a scalar value.  A recording will be found if the input matches any one of the above fields.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"media: \\\"Chickens laughing\\\"\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n## Media Usage Object\n\nThe Media Usage Object shows if the media file is used in Routes, Queues, Menus, etc.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"description\",\n    \"0-1\": \"Textual description of the usage\",\n    \"1-0\": \"object_type\",\n    \"1-1\": \"Type of object which uses the media, may be route, queue, menu ...\",\n    \"2-0\": \"object\",\n    \"2-1\": \"Detail description of the object which uses the media.  See Media Usage Object Details below\"\n  },\n  \"cols\": 2,\n  \"rows\": 3\n}\n[/block]\n## Media Usage Object Details\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"id\",\n    \"h-0\": \"Property\",\n    \"h-1\": \"Description\",\n    \"0-1\": \"Route ID, menu ID, queue ID ...\",\n    \"1-0\": \"voip_id\",\n    \"1-1\": \"API account ID\",\n    \"2-0\": \"name\",\n    \"2-1\": \"Name of object which uses the media.  May be null if API request is Extension level and object was created in Account level\"\n  },\n  \"cols\": 2,\n  \"rows\": 3\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"description\\\": \\\"Media is used by a Route as Recording\\\",\\n    \\\"object_type\\\": \\\"route\\\",\\n    \\\"object\\\": {\\n         \\\"id\\\": 645433,\\n         \\\"voip_id\\\": 10000002,\\n         \\\"name\\\": \\\"\\\"\\n    }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","updates":[],"order":0,"isReference":true,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"57624356653c2d2200fec7b1","category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Account Media","slug":"account-media","order":17,"from_sync":false,"reference":true,"_id":"57624356653c2d2200fec7a4","__v":0,"version":"57624356653c2d2200fec79c","project":"55c8cff571d7580d0063a5e5","createdAt":"2016-05-16T21:10:19.740Z"},"project":"55c8cff571d7580d0063a5e5","user":"55c8cf9471d7580d0063a5e4","__v":4,"createdAt":"2016-05-16T21:13:16.506Z","parentDoc":null,"version":{"version":"4","version_clean":"4.0.0","codename":"","is_stable":true,"is_beta":true,"is_hidden":false,"is_deprecated":false,"categories":["57624356653c2d2200fec79d","57624356653c2d2200fec79e","57624356653c2d2200fec79f","57624356653c2d2200fec7a0","57624356653c2d2200fec7a1","57624356653c2d2200fec7a2","57624356653c2d2200fec7a3","57624356653c2d2200fec7a4","57624356653c2d2200fec7a5","57624356653c2d2200fec7a6","57624356653c2d2200fec7a7","57624356653c2d2200fec7a8","57624356653c2d2200fec7a9","57624356653c2d2200fec7aa","5779ca1b99b40b0e005abb3a","5779d198aea88b0e00f63277","5797d3ab17ced017003c4be4","57ac170ef1cdae0e0053cdfc","57dbfc723ed3450e00dc9e6d","5804d12d16161c0f0077df9b","5841064b652e5b0f0015a7c8","588b5e5f2966b2230009cbf9","58a68ebf3239fa0f00857619","58c23c8b4922930f0050ac91","58fd1460809fc30f00f2ee07","5934eaf5328680002d77de6a","594bf91601cfe6000f40f4c5","595c4ed696b447001ba0cf6d","596524495cee50001575f5be","5970d4f1313162004dd303b5","59780fac24dbd1001a1fa057","59a8cfd3ead78a002d63cafe","59e0323d93da1f001c9ec170","5b0c16f2be9fcb0003e28222","5ba8fd1a4c8c220003a08f0f","5ede526e75bc22005d0adecc"],"_id":"57624356653c2d2200fec79c","createdAt":"2016-06-16T06:12:38.244Z","releaseDate":"2016-06-16T06:12:38.244Z","__v":23,"project":"55c8cff571d7580d0063a5e5"},"githubsync":""}
[block:callout] { "type": "info", "body": "Note: This API is for users with Account Owner scope access token. Users with Extension User scope token should invoke the Extension level Media API with the following definition:\n\nhttps://api.phone.com/v4/accounts/:account_id/extensions/:extension_id/media" } [/block] Your Phone.com account has two kinds of media that can be used in various ways: Hold Music and Greetings. Hold Music can be used in [routes](doc:account-routes), [queues](doc:account-queues), and anywhere the caller might be placed on hold. Your account has access to a set of standard hold music options, and optionally another set of premium hold music options. You can also upload your own hold music, subject to copyright limitations. Greetings are verbal messages that can be played in various places to provide the caller with important information. For example, greetings are used when a caller first enters a [menu](doc:account-menus) or if they enter an invalid option. You also might use a greeting to alert the user to the fact that their call is being recorded. ## Supported Services * [List Media](doc:list-account-media) * [List Media Usage](doc:list-account-media-usage) * [Get Media](doc:get-account-media) * [Create Media](doc:create-account-media) * [Replace Media](doc:replace-account-media) * [Delete Media](doc:delete-account-media) ## Summary Object The Recording Summary Object is used to briefly represent a media recording. It can be seen in several places throughout this API. Here are the properties: [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "0-0": "`id`", "0-1": "Integer", "0-2": "Recording ID. Read-only.", "1-0": "`voip_id`", "1-1": "Integer", "1-2": "Account ID", "2-0": "'name'", "2-1": "String", "2-2": "Name of recording", "3-0": "'type'", "3-2": "Can be `hold_music` or `greeting`. Indicates the purpose of this recording and where it can be used.", "3-1": "String", "4-0": "'created_at'", "4-1": "String", "4-2": "Timestamp of media creation time", "5-0": "'created_at_epoch'", "5-1": "Integer", "5-2": "Timestamp in unix format", "6-0": "'duration'", "6-1": "Integer", "6-2": "Duration of greeting", "7-0": "'notes'", "7-1": "String", "7-2": "Notes of greeting", "8-0": "'expires_at'", "8-1": "Integer", "8-2": "Time when greeting is removed from account", "9-0": "'origin'", "9-1": "String", "9-2": "'file' or 'tts'", "10-0": "'is_temporary'", "10-1": "Boolean", "10-2": "true or false. If set to true, will be removed from account at time 'expires_at'", "11-0": "'randomized'", "11-1": "String", "11-2": "Y or N. Start the greeting from random location, instead of the beginning", "12-0": "'filename'", "12-1": "String", "12-2": "Name of file to be uploaded, when 'origin' is set to 'file'" }, "cols": 3, "rows": 13 } [/block] Here is an example: [block:code] { "codes": [ { "code": "{\n \"id\": 629061,\n \"voip_id\": 349034,\n \"name\": \"Main Menu Hold Music\",\n \"type\": \"hold_music\",\n \"created_at\": \"2017-03-17T07:32:31-07:00\",\n \"created_at_epoch\": 1489761151,\n \"duration\": null,\n \"notes\": null,\n \"expires_at\": null,\n \"origin\": \"file\",\n \"is_temporary\": false,\n \"randomized\": \"N\",\n \"filename\": \"test.mp3\",\n}", "language": "json" } ] } [/block] ## Full Object The Full Recording Object and the Summary Recording Object are the same. ## Lookup Object The Recording Lookup Object is used to link to a media recording from another object. This is used, for example, when defining actions for [routes](doc:account-routes). Only *one* of the following properties need to be included. If multiple are specified, then *all* properties must match one of your recordings. [block:parameters] { "data": { "h-0": "Property", "h-1": "Description", "0-0": "`id`", "0-1": "ID", "1-0": "`name`", "1-1": "Name" }, "cols": 2, "rows": 2 } [/block] Here are some examples: [block:code] { "codes": [ { "code": "media: {\n \"id\": 772352\n}", "language": "json" } ] } [/block] [block:code] { "codes": [ { "code": "media: {\n \"name\": \"Chickens laughing\"\n}", "language": "json" } ] } [/block] Instead of inputting an object, you can also use a scalar value. A recording will be found if the input matches any one of the above fields. [block:code] { "codes": [ { "code": "media: \"Chickens laughing\"", "language": "json" } ] } [/block] ## Media Usage Object The Media Usage Object shows if the media file is used in Routes, Queues, Menus, etc. [block:parameters] { "data": { "h-0": "Property", "h-1": "Description", "0-0": "description", "0-1": "Textual description of the usage", "1-0": "object_type", "1-1": "Type of object which uses the media, may be route, queue, menu ...", "2-0": "object", "2-1": "Detail description of the object which uses the media. See Media Usage Object Details below" }, "cols": 2, "rows": 3 } [/block] ## Media Usage Object Details [block:parameters] { "data": { "0-0": "id", "h-0": "Property", "h-1": "Description", "0-1": "Route ID, menu ID, queue ID ...", "1-0": "voip_id", "1-1": "API account ID", "2-0": "name", "2-1": "Name of object which uses the media. May be null if API request is Extension level and object was created in Account level" }, "cols": 2, "rows": 3 } [/block] [block:code] { "codes": [ { "code": "{\n \"description\": \"Media is used by a Route as Recording\",\n \"object_type\": \"route\",\n \"object\": {\n \"id\": 645433,\n \"voip_id\": 10000002,\n \"name\": \"\"\n }\n}", "language": "json" } ] } [/block]