REST ClientFabricSWML Scripts
list
List SWML script resources in the project.
Response
datalist of objectsRequired
An array of objects that contain a list of SWML Script data
linksobjectRequired
Object containing pagination links
Response Example
Response
1 [ 2 { 3 "data": [ 4 { 5 "id": "993ed018-9e79-4e50-b97b-984bd5534095", 6 "project_id": "1313fe58-5e14-4c11-bbe7-6fdfa11fe780", 7 "display_name": "Welcome Script", 8 "type": "swml_script", 9 "created_at": "2024-05-06T12:20:00Z", 10 "updated_at": "2024-05-06T12:25:00Z", 11 "swml_script": { 12 "contents": { 13 "sections": { 14 "main": [ 15 { 16 "play": { 17 "url": "https://cdn.signalwire.com/swml/audio.mp3" 18 } 19 } 20 ] 21 }, 22 "version": "1.0.0" 23 }, 24 "display_name": "Welcome Script", 25 "id": "993ed018-9e79-4e50-b97b-984bd5534095", 26 "request_url": "https://example.com/swml_script", 27 "script_type": "calling" 28 } 29 } 30 ], 31 "links": { 32 "self": "https://example.signalwire.com/api/fabric/resources/swml_scripts?page_number=0&page_size=50", 33 "first": "https://example.signalwire.com/api/fabric/resources/swml_scripts?page_number=0&page_size=50" 34 } 35 } 36 ]
Example
1 from signalwire.rest import RestClient 2 3 client = RestClient( 4 project="your-project-id", 5 token="your-api-token", 6 host="your-space.signalwire.com", 7 ) 8 9 response = client.fabric.swml_scripts.list() 10 for item in response.get("data", []): 11 print(f"{item['display_name']}: {item['id']}")