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
[{"data": [{"id": "993ed018-9e79-4e50-b97b-984bd5534095","project_id": "1313fe58-5e14-4c11-bbe7-6fdfa11fe780","display_name": "Welcome Script","type": "swml_script","created_at": "2024-05-06T12:20:00Z","updated_at": "2024-05-06T12:25:00Z","swml_script": {"contents": {"sections": {"main": [{"play": {"url": "https://cdn.signalwire.com/swml/audio.mp3"}}]},"version": "1.0.0"},"display_name": "Welcome Script","id": "993ed018-9e79-4e50-b97b-984bd5534095","request_url": "https://example.com/swml_script","script_type": "calling"}}],"links": {"self": "https://example.signalwire.com/api/fabric/resources/swml_scripts?page_number=0&page_size=50","first": "https://example.signalwire.com/api/fabric/resources/swml_scripts?page_number=0&page_size=50"}}]
Example
import { RestClient } from "@signalwire/sdk";const client = new RestClient({project: "your-project-id",token: "your-api-token",host: "your-space.signalwire.com",});const response = await client.fabric.swmlScripts.list();for (const item of response.data ?? []) {console.log(`${item.display_name}: ${item.id}`);}