Asset
Assets are static files that you can host at a particular domain in an Environment.
The steps to create Assets are as follows:
- Create an Asset (this resource)
- Create an Asset Version
We will need the Asset Version SID to include this Asset in a Build.
Asset properties
Resource Properties in REST API format | |
---|---|
sid
|
The unique string that we created to identify the Asset resource. |
account_sid
|
The SID of the Account that created the Asset resource. |
service_sid
|
The SID of the Service that the Asset resource is associated with. |
friendly_name
|
The string that you assigned to describe the Asset resource. It can be a maximum of 255 characters. |
date_created
|
The date and time in GMT when the Asset resource was created specified in ISO 8601 format. |
date_updated
|
The date and time in GMT when the Asset resource was last updated specified in ISO 8601 format. |
url
|
The absolute URL of the Asset resource. |
links
|
The URLs of the Asset resource's nested resources. |
Create an Asset resource
https://serverless.twilio.com/v1/Services/{ServiceSid}/Assets
Parameters
Parameters in REST API format | |
---|---|
service_sid
Path
|
The SID of the Service to create the Asset resource under. |
friendly_name
Required
|
A descriptive string that you create to describe the Asset resource. It can be a maximum of 255 characters. |
Example 1
Fetch an Asset resource
https://serverless.twilio.com/v1/Services/{ServiceSid}/Assets/{Sid}
Parameters
Parameters in REST API format | |
---|---|
service_sid
Path
|
The SID of the Service to fetch the Asset resource from. |
sid
Path
|
The SID that identifies the Asset resource to fetch. |
Example 1
Read multiple Asset resources
https://serverless.twilio.com/v1/Services/{ServiceSid}/Assets
Parameters
Parameters in REST API format | |
---|---|
service_sid
Path
|
The SID of the Service to read the Asset resources from. |
Example 1
Update an Asset resource
https://serverless.twilio.com/v1/Services/{ServiceSid}/Assets/{Sid}
Parameters
Parameters in REST API format | |
---|---|
service_sid
Path
|
The SID of the Service to update the Asset resource from. |
sid
Path
|
The SID that identifies the Asset resource to update. |
friendly_name
Required
|
A descriptive string that you create to describe the Asset resource. It can be a maximum of 255 characters. |
Example 1
Delete an Asset resource
https://serverless.twilio.com/v1/Services/{ServiceSid}/Assets/{Sid}
Parameters
Parameters in REST API format | |
---|---|
service_sid
Path
|
The SID of the Service to delete the Asset resource from. |
sid
Path
|
The SID that identifies the Asset resource to delete. |
Example 1
Need some help?
We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.