Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Build Status


The /Status endpoint for each Build lets you retrieve the status of that Build. We recommend using this endpoint to poll for the status, rather than the /Builds endpoint.


BuildStatus Properties

buildstatus-properties page anchor
Resource properties
sidtype: SID<ZB>
Not PII

The unique string that we created to identify the Build resource.

Pattern:
^ZB[0-9a-fA-F]{32}$
Min length:
34
Max length:
34

account_sidtype: SID<AC>

service_sidtype: SID<ZS>

The SID of the Service that the Build resource is associated with.

Pattern:
^ZS[0-9a-fA-F]{32}$
Min length:
34
Max length:
34

statustype: enum<string>

The status of the Build. Can be: building, completed, or failed.

Possible values:
buildingcompletedfailed

urltype: string<uri>

The absolute URL of the Build Status resource.


Fetch a BuildStatus resource

fetch-a-buildstatus-resource page anchor
GET https://serverless.twilio.com/v1/Services/{ServiceSid}/Builds/{Sid}/Status

Parameters

fetch-parameters page anchor
URI parameters
ServiceSidtype: string
Path ParameterNot PII

The SID of the Service to fetch the Build resource from.


Sidtype: SID<ZB>
Path ParameterNot PII

The SID of the Build resource to fetch.

Pattern:
^ZB[0-9a-fA-F]{32}$
Min length:
34
Max length:
34
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

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

Output

_10
{
_10
"sid": "ZBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"service_sid": "ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"status": "completed",
_10
"url": "https://serverless.twilio.com/v1/Services/ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Builds/ZB00000000000000000000000000000000/Status"
_10
}


Rate this page: