Create SWML Script
Changed onCreates a resource that stores a calling or messaging SWML document in SignalWire. Use it for versioned instructions that can run without fetching content from your server; choose Create SWML webhook when your server must generate different SWML for each request, or Create cXML Script for cXML applications.
Permissions
The API token used to authenticate must have the following scope(s) enabled to make a successful request: Voice, Messaging, Fax, or Video.
Learn more about API scopes.
Request
- Base URLhttps://{Your_Space_Name}.signalwire.com
- URLhttps://{Your_Space_Name}.signalwire.com/api/fabric/resources/swml_scripts
- AuthHTTP basic
Request body
Example request
{
"name": "Welcome Script",
"script_type": "calling",
"status_callback_url": "https://example.com/status"
}Response
The request has succeeded.
Example response
{
"display_name": "Welcome Script",
"type": "swml_script",
"created_at": "2024-05-06T12:20:00Z",
"updated_at": "2024-05-06T12:20:00Z",
"swml_script": {
"display_name": "Booking Assistant",
"script_type": "calling",
"request_url": "https://example.com/swml_script",
"contents": {
"version": "1.0.0",
"sections": {
"main": [
{
"play": {
"url": "https://cdn.signalwire.com/swml/audio.mp3"
}
}
]
}
},
"status_callback_url": "https://website.com/status",
"status_callback_method": "POST"
}
}Changes
- info
request property
/list-of-types was widened by adding typesstringto media typeapplication/json - info
request property
/list-of-types was widened by adding typesstringto media typeapplication/json - info
removed 'unevaluatedProperties' constraint from the request property
/ - info
removed 'unevaluatedProperties' constraint from the request property
/
- info
- breaking
the
/request property type changed from no type toobject - breaking
the
/request property type changed from no type toobject - breaking
added 'unevaluatedProperties' constraint to the request property
/ - breaking
added 'unevaluatedProperties' constraint to the request property
/ - breaking
the
///response's property type changed from no type toobjectfor status - breaking
the
///response's property type changed from no type toobjectfor status - warning
removed from the
/request propertyallOflist - warning
removed from the
/request propertyallOflist - info
removed from the
///response propertyallOflist for the response status - info
removed from the
///response propertyallOflist for the response status - info
added 'unevaluatedProperties' constraint to the
///response property for the status - info
added 'unevaluatedProperties' constraint to the
///response property for the status
- breaking
Some revisions have not been checked yet.