Skip to main content

The Address Namespace

The Address namespace includes methods that give you access to Address objects.

The address object

The Address object represents a unique identifier for different types of entities in the system. Each address has the following properties:

FieldDescription
idA unique identifier for the address.
nameThe name of the address.
display_nameThe display name of the address.
typeThe type of the address. It can be one of the following: subscriber, room, app, call.
cover_urlThe URL of the cover image for the address. This can be null.
preview_urlThe URL of the preview image for the address. This can be null.
channelsAn object containing the audio, video, and messaging channels for the address. Each channel is represented by a URL.

Here is an example of an Address object:

{
"id": "39e38f64-d694-4b62-ace8-a2b91359abca",
"name": "jim-carrey",
"display_name": "Jim Carrey",
"type": "subscriber",
"cover_url": "null",
"preview_url": null,
"channels": {
"audio": "/private/jim-carrey?channel=audio",
"video": "/private/jim-carrey?channel=video"
}
}

Methods

getAddresses

getAddresses(options): Promise<{ data: Address[], hasNext, hasPrev }>

Returns a list of Addresses.

Parameters

NameTypeDefault valueDescription
optionsobject-
options.type?stringundefinedThe address type to filter for. Possible values: subscriber, room, app, call.
options.displayName?stringundefinedThe address display name to filter for

Returns

Promise<{ data: Address[], hasNext, hasPrev }>

Example

await client.address.getAddresses();
{
"data": [
{
"id": "39e38f64-d694-4b62-ace8-a2b91359abca",
"name": "jim-carrey",
"display_name": "Jim Carrey",
"type": "subscriber",
"cover_url": "null",
"preview_url": null,
"channels": {
"audio": "/private/jim-carrey?channel=audio",
"video": "/private/jim-carrey?channel=video"
}
},
{
"id": "39e38f64-d694-4b62-ace8-a2b91359abca",
"name": "john-travolta",
"display_name": "John Travolta",
"type": "subscriber",
"cover_url": "null",
"preview_url": null,
"channels": {
"audio": "/private/john-travolta?channel=audio",
"video": "/private/john-travolta?channel=video"
}
}
],
"hasNext": false,
"hasPrev": false
}

getAddress

getAddress(options): Promise<Address>

Get the details of a particular address ID.

Parameters

NameTypeDefault valueDescription
optionsobject-
options.idstringundefinedThe ID to get address details for.

Returns

Promise<Address>

Example

await client.address.getAddress({ id: "39e38f64-d694-4b62-ace8-a2b91359abca" });
{
"id": "39e38f64-d694-4b62-ace8-a2b91359abca",
"name": "jim-carrey",
"display_name": "Jim Carrey",
"type": "subscriber",
"cover_url": "null",
"preview_url": null,
"channels": {
"audio": "/private/jim-carrey?channel=audio",
"video": "/private/jim-carrey?channel=video"
}
}