Skip to contentSkip to navigationSkip to topbar
Rate this Page:

Function Version Content


The /Content endpoint for each FunctionVersion lets you retrieve the code.


FunctionVersionContent Properties

functionversioncontent-properties page anchor
Resource properties
sidtype: SID<ZN>Not PII

The unique string that we created to identify the Function Version resource.


service_sidtype: SID<ZS>Not PII

The SID of the Service that the Function Version resource is associated with.


function_sidtype: SID<ZH>Not PII

The SID of the Function that is the parent of the Function Version.


contenttype: stringNot PII

The content of the Function Version resource.


urltype: string<URI>Not PII

Fetch a FunctionVersionContent resource

fetch-a-functionversioncontent-resource page anchor
GET https://serverless.twilio.com/v1/Services/{ServiceSid}/Functions/{FunctionSid}/Versions/{Sid}/Content

Parameters

fetch-parameters page anchor
URI parameters
ServiceSidtype: stringNot PII
Path Parameter

The SID of the Service to fetch the Function Version content from.


FunctionSidtype: SID<ZH>Not PII
Path Parameter

The SID of the Function that is the parent of the Function Version content to fetch.


Sidtype: SID<ZN>Not PII
Path Parameter

The SID of the Function Version content to fetch.

Fetch a FunctionVersionContent

fetch-a-functionversioncontent page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_13
// Download the helper library from https://www.twilio.com/docs/node/install
_13
// Find your Account SID and Auth Token at twilio.com/console
_13
// and set the environment variables. See http://twil.io/secure
_13
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_13
const authToken = process.env.TWILIO_AUTH_TOKEN;
_13
const client = require('twilio')(accountSid, authToken);
_13
_13
client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_13
.functions('ZHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_13
.functionVersions('ZNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_13
.functionVersionContent()
_13
.fetch()
_13
.then(function_version_content => console.log(function_version_content.sid));

Output

_13
{
_13
"sid": "ZNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_13
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_13
"service_sid": "ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_13
"function_sid": "ZHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_13
"content": "exports.handler = function (context, event, callback) {
_13
const request = require(\"request\");
_13
return request(\"http://www.google.com\", function (error, response, body) {
_13
callback(null, response.statusCode);
_13
});
_13
};",
_13
"url": "https://serverless.twilio.com/v1/Services/ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Functions/ZH00000000000000000000000000000000/Versions/ZN00000000000000000000000000000000/Content"
_13
}


Rate this Page: