Skip to contentSkip to navigationSkip to topbar
On this page

Schema Version Resource



Version Properties

version-properties page anchor
Property nameTypeRequiredDescriptionChild properties
idstring

Optional

Not PII

The unique identifier of the schema. Each schema can have multiple versions, that share the same id.


schema_versioninteger

Optional

The version of this schema.

Default: 0

date_createdstring<date-time>

Optional

The date the schema version was created, given in ISO 8601 format.


urlstring<uri>

Optional

The URL of this resource.


rawstring<uri>

Optional


Fetch a SchemaVersion resource

fetch-a-schemaversion-resource page anchor
GET https://events.twilio.com/v1/Schemas/{Id}/Versions/{SchemaVersion}

Path parameters

path-parameters page anchor
Property nameTypeRequiredPIIDescription
Idstringrequired

The unique identifier of the schema. Each schema can have multiple versions, that share the same id.


SchemaVersionintegerrequired

The version of the schema

Fetch Schema VersionLink to code sample: Fetch Schema Version
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function fetchSchemaVersion() {
11
const version = await client.events.v1
12
.schemas("Messaging.MessageStatus")
13
.versions(42)
14
.fetch();
15
16
console.log(version.id);
17
}
18
19
fetchSchemaVersion();

Output

1
{
2
"id": "Messaging.MessageStatus",
3
"schema_version": 42,
4
"public": true,
5
"date_created": "2015-07-30T20:00:00Z",
6
"url": "https://events.twilio.com/v1/Schemas/Messaging.MessageStatus/Versions/1",
7
"raw": "https://events-schemas.twilio.com/Messaging.MessageStatus/1"
8
}

Read multiple SchemaVersion resources

read-multiple-schemaversion-resources page anchor
GET https://events.twilio.com/v1/Schemas/{Id}/Versions

Property nameTypeRequiredPIIDescription
Idstringrequired

The unique identifier of the schema. Each schema can have multiple versions, that share the same id.

Property nameTypeRequiredPIIDescription
PageSizeinteger

Optional

How many resources to return in each list page. The default is 50, and the maximum is 1000.

Minimum: 1Maximum: 1000

Pageinteger

Optional

The page index. This value is simply for client state.

Minimum: 0

PageTokenstring

Optional

The page token. This is provided by the API.

1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function listSchemaVersion() {
11
const versions = await client.events.v1
12
.schemas("Id")
13
.versions.list({ limit: 20 });
14
15
versions.forEach((v) => console.log(v.id));
16
}
17
18
listSchemaVersion();

Output

1
{
2
"schema_versions": [
3
{
4
"id": "Messaging.MessageStatus",
5
"schema_version": 1,
6
"public": true,
7
"date_created": "2015-07-30T20:00:00Z",
8
"url": "https://events.twilio.com/v1/Schemas/Messaging.MessageStatus/Versions/1",
9
"raw": "https://events-schemas.twilio.com/Messaging.MessageStatus/1"
10
},
11
{
12
"id": "Messaging.MessageStatus",
13
"schema_version": 2,
14
"public": true,
15
"date_created": "2015-07-30T20:00:00Z",
16
"url": "https://events.twilio.com/v1/Schemas/Messaging.MessageStatus/Versions/2",
17
"raw": "https://events-schemas.twilio.com/Messaging.MessageStatus/2"
18
}
19
],
20
"meta": {
21
"page": 0,
22
"page_size": 50,
23
"first_page_url": "https://events.twilio.com/v1/Schemas/Messaging.MessageStatus/Versions?PageSize=50&Page=0",
24
"previous_page_url": null,
25
"url": "https://events.twilio.com/v1/Schemas/Messaging.MessageStatus/Versions?PageSize=50&Page=0",
26
"next_page_url": null,
27
"key": "schema_versions"
28
}
29
}

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.