Address Namespace

View as Markdown

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:

1{
2 "id": "39e38f64-d694-4b62-ace8-a2b91359abca",
3 "name": "jim-carrey",
4 "display_name": "Jim Carrey",
5 "type": "subscriber",
6 "cover_url": "null",
7 "preview_url": null,
8 "channels": {
9 "audio": "/private/jim-carrey?channel=audio",
10 "video": "/private/jim-carrey?channel=video"
11 }
12}

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

1await client.address.getAddresses();
1{
2 "data": [
3 {
4 "id": "39e38f64-d694-4b62-ace8-a2b91359abca",
5 "name": "jim-carrey",
6 "display_name": "Jim Carrey",
7 "type": "subscriber",
8 "cover_url": "null",
9 "preview_url": null,
10 "channels": {
11 "audio": "/private/jim-carrey?channel=audio",
12 "video": "/private/jim-carrey?channel=video"
13 }
14 },
15 {
16 "id": "39e38f64-d694-4b62-ace8-a2b91359abca",
17 "name": "john-travolta",
18 "display_name": "John Travolta",
19 "type": "subscriber",
20 "cover_url": "null",
21 "preview_url": null,
22 "channels": {
23 "audio": "/private/john-travolta?channel=audio",
24 "video": "/private/john-travolta?channel=video"
25 }
26 }
27 ],
28 "hasNext": false,
29 "hasPrev": false
30}

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

1await client.address.getAddress({ id: "39e38f64-d694-4b62-ace8-a2b91359abca" });
1{
2 "id": "39e38f64-d694-4b62-ace8-a2b91359abca",
3 "name": "jim-carrey",
4 "display_name": "Jim Carrey",
5 "type": "subscriber",
6 "cover_url": "null",
7 "preview_url": null,
8 "channels": {
9 "audio": "/private/jim-carrey?channel=audio",
10 "video": "/private/jim-carrey?channel=video"
11 }
12}