The URL-friendly string by which the Asset Version can be referenced. It can be a maximum of 255 characters. All paths begin with a forward slash ('/'). If an Asset Version creation request is submitted with a path not containing a leading slash, the path will automatically be prepended with one.
Create an Asset Version resource to upload a file to an Asset resource. The Asset Version resource is created by making a POST request to a dedicated URL—a URL that is different from the URL used to read and fetch the resource.
The following example creates an Asset Version resource using the language of your choice (or curl) and an external file, my-asset.png, which contains the Asset to upload.
Upload Asset
Node.js
Python
C#
Java
PHP
Ruby
curl
_36
const fs = require('fs');
_36
// Before running this code, install "form-data" and "axios" using `npm install form-data axios`
_36
const FormData = require('form-data');
_36
const axios = require('axios');
_36
_36
// Find your Account SID and Auth Token at twilio.com/console
_36
// and set the environment variables. See http://twil.io/secure
Note that the Serverless upload endpoint is on a different subdomain from the rest of the Serverless API (serverless-upload.twilio.com instead of serverless.twilio.com), and is not supported by the Twilio Helper Libraries at this time.
The create action accepts these parameters:
Parameter
Description
Content
The asset to upload.
AssetSid
The SID of the Asset resource to upload this asset to.
Path
The path to assign the asset. Must be URL Friendly, without fragments, and ;,?:@+&$()' " are disallowed).
ServiceSid
The SID of the Asset's Service.
Visibility
The visibility of the asset. Can be public, protected, or private.
Fetch an AssetVersion resource
GET https://serverless.twilio.com/v1/Services/{ServiceSid}/Assets/{AssetSid}/Versions/{Sid}