The Cisco Webex JS SDK
All of the examples in these API docs assume you've gotten an authenticated Webex instance (unless otherwise specified) using one of the methods below.
webex
has three basic modes of operation:
This is the quickest way to get up and running with our JavaScript SDK. Simply set the environment variable WEBEX_ACCESS_TOKEN
to your access token and add the following line at the top of your JavaScript file to get a ready-to-use instance.
You can get your
WEBEX_ACCESS_TOKEN
from the Cisco Webex for Developers portal.
webex/env
is also a great way to get started with bots.
Our JavaScript SDK provides out-of-the-box support for the OAuth 2.0 Implicit Grant Flow.
You'll need to register an OAuth Client to get your "authorization string"
Use the steps under Bundling (or something similar) to get the SDK into your browser, then use the following JavaScript to get started:
You'll need to bundle the SDK to use it in a web browser. Right now, we do all our SDK testing with Browserify, but our Cisco Webex Widgets use webpack.
The following snippet is the bare minimum to get our code into a form suitable for a web browser. You'll probably want to additionally pipe it through a minifier like UglifyJS before going to production.
Then, just load your bundle using:
Though the implicit flow is great for single page apps, it's not ideal for integrations that might need to do things on your users' behalf months in the future. We additionally support the OAuth 2.0 Authorization Code Grant flow, but due to its complexity, there's a bit you'll need to wire up in your app to take advantage of it. The following is an example of how an Express app might do authentication.
See Browser Guide and Server Guide
Create a new Webex instance
Webex
:
Create a new Webex instance configured for your OAuth client
const webex = Webex.init({
config: {
credentials: {
authorizationString: `<AUTHORIZATION URL FROM DEVELOPER PORTAL>`
}
}
});
Create a new Webex instance configured for a Bot
const webex = Webex.init({
credentials: `<BOT TOKEN FROM DEVELOPER PORTAL>`
});
Browser support for OAuth2. Automatically parses the URL hash for an access token
Alias of AuthorizationBrowser#isAuthorizing
Type: boolean
Kicks off the Authorization Code grant flow. Typically called via AuthorizationBrowser#initiateLogin
(Object)
Promise
:
Kicks off the Implicit Code grant flow. Typically called via AuthorizationBrowser#initiateLogin
(Object)
Promise
:
Requests a Webex access token for a user already authenticated into your product.
Note: You'll need to supply a jwtRefreshCallback of the form
Promise<jwt> = jwtRefreshCallback(webex)
for automatic token refresh to
work.
Promise
:
Called by WebexCore#logout(). Redirects to the logout page
Promise
:
NodeJS support for OAuth2
Alias of AuthorizationNode#isAuthorizing
Type: boolean
Maintain a cache of meetings and sync with services.
Extends WebexPlugin
(...any)
Creates a noise reduction effect
(INoiseReductionEffect)
optional custom effect options
Promise<effect>
:
noise reduction effect.
Creates a virtual background effect
(IVirtualBackgroundEffect)
optional custom effect options
Promise<effect>
:
virtual background effect.
gets the reachability instance for Meetings
Reachability
:
gets the personal meeting room instance, for saved PMR values for this user
PersonalMeetingRoom
:
Create a meeting or return an existing meeting.
When meeting info passed it should be complete, e.g.: fetched after password or captcha provided
(string)
sipURL, phonenumber, or locus object}
(DESTINATION_TYPE?
= null
)
the optional specified type, such as locusId
(Boolean
= false
)
whether a random delay should be added to fetching meeting info
(Object
= {}
)
extra parameters to be provided when fetching meeting info
(string
= undefined
)
the optional specified correlationId (callStateForMetrics.correlationId can be provided instead)
(Boolean
= false
)
whether to throw an error if meeting info fails to fetch (for calls that are not 1:1 or content share)
(CallStateForMetrics
= undefined
)
information about call state for metrics
(Object?
= undefined
)
Pre-fetched complete meeting info
(String?
= undefined
)
meeting info prefetch url
Promise<Meeting>
:
A new Meeting.
Syncs all the meetings from server. Does nothing and returns immediately if unverified guest.
(boolean
= {}
)
whether the sync should keep only locus meetings or any other meeting in meetingCollection
Name | Description |
---|---|
keepOnlyLocusMeetings.keepOnlyLocusMeetings any
(default true )
|
Promise<void>
:
The PersonalMeetingRoom object to interact with server
Type: Object
If the meetings plugin has been registered and listening via Meetings#register
Type: Boolean
Uploads logs to the webex services for tracking
String
:
feedback ID logs were submitted under
The property name for what collection will be stored, i.e., this.meetingInfos, this.meetings, etc.
Type: String
Meetings Ready Event Emitted when the meetings instance on webex is ready
Meetings Network Disconnected Event Emitted when the meetings instance is disconnected from the internal mercury server
Meetings Registered Event Emitted when the meetings instance has been registered and listening
Meeting Removed Event Emitted when a meeting was removed from the cache of meetings
Type: Object
Meeting is the crux of the plugin
Checks if the supplied password/host key is correct. It returns a promise with information whether the password and captcha code were correct or not.
(String)
this can be either a password or a host key, can be undefined if only captcha was required
(String)
can be undefined if captcha was not required by the server
(Boolean
= false
)
whether Call Analyzer events should be sent when fetching meeting information
Promise<{isPasswordValid: boolean, requiredCaptcha: boolean, failureReason: MEETING_INFO_FAILURE_REASON}>
:
Admit the guest(s) to the call once they are waiting. If the host/cohost is in a breakout session, the locus url of the session must be provided as the authorizingLocusUrl. Regardless of host/cohost location, the locus Id (lid) in the path should be the locus Id of the main, which means the locus url of the api call must be from the main session. If these loucs urls are not provided, the function will do the check.
Promise
:
see #members.admitMembers
Shorthand function to join AND set up media
(Object
= {}
)
options to join with media
Name | Description |
---|---|
options.joinOptions JoinOptions?
|
see #join() |
options.mediaOptions AddMediaOptions?
|
see #addMedia() |
Promise
:
-- {join: see join(), media: see addMedia()}
joinWithMedia({
joinOptions: {resourceId: 'resourceId' },
mediaOptions: {
localStreams: { microphone: microphoneStream, camera: cameraStream }
}
})
Internal version of addMedia() with some more arguments for finer control of its behavior
(Function)
callback to determine the icePhase for CA "client.ice.end" failure events
(TurnServerInfo)
TURN server information
(boolean)
if true, TURN discovery will be done
(AddMediaOptions
= {}
)
same as options of the public addMedia() method
Promise<void>
:
Checks if there are any queued media updates and runs the first one from the queue if we are in a state that allows doing that.
undefined
:
Updates the media connection - it allows to enable/disable all audio/video/share in the meeting. This does not affect the published tracks, so for example if a microphone track is published and updateMedia({audioEnabled: false}) is called, the audio will not be sent or received anymore, but the track's "published" state is not changed and when updateMedia({audioEnabled: true}) is called, the sending of the audio from the same track will resume.
(Object)
Name | Description |
---|---|
options.audioEnabled boolean
|
[optional] enables/disables receiving and sending of main audio in the meeting |
options.videoEnabled boolean
|
[optional] enables/disables receiving and sending of main video in the meeting |
options.shareEnabled boolean
|
[optional] enables/disables receiving and sending of screen share in the meeting |
Promise
:
Leave the current meeting
(Object
= {}as any
)
leave options
Name | Description |
---|---|
options.resourceId String?
|
the device with which to leave from, empty if just the computer |
options.clientEventLeaveReason String?
|
the leaveReason to include in the Call Analyzer event. Must be one of: 'paired-leave' | 'one-to-one' | 'ended-by-locus' (defaults to no reason) https://sqbu-github.cisco.com/WebExSquared/event-dictionary/blob/main/diagnostic-events.raml#L796 |
options.reason String?
|
only used for logging |
Promise
:
Sends request to change layout type for the current meeting for the specific participant/device only
(Object
= {}as any
)
preferred dimensions for the remote main and content streams (server can ignore it)
Name | Description |
---|---|
renderInfo.main Object
|
preferred dimensions for the remote main video stream |
renderInfo.main.width Number
|
preferred width of main video stream |
renderInfo.main.height Number
|
preferred height of main video stream |
renderInfo.content Object
|
preferred dimensions for the remote content share stream |
renderInfo.content.width Number
|
preferred width of content share stream |
renderInfo.content.height Number
|
preferred height of content share stream |
Promise
:
Send a reaction inside the meeting.
(ReactionServerType)
type of reaction to be sent. Example: "thumbs_up"
(SkinToneType)
skin tone for the reaction. Example: "medium_dark"
Promise
:
Call state used for metrics
Type: CallStateForMetrics
Type: Annotation
helper class for managing receive slots (for multistream media connections)
Object containing helper classes for managing media requests for audio/video/screenshare (for multistream media connections) All multistream media requests sent out for this meeting have to go through them.
Type: MeetingStateMachine
If true, then media is sent over multiple separate streams. If false, then media is transcoded by the server into a single stream.
Passing only info as we send basic info for meeting added event
Type: MediaProperties
Type: InMeetingActions
Password status. If it's PASSWORD_STATUS.REQUIRED then verifyPassword() needs to be called with the correct password before calling join()
Type: PASSWORD_STATUS
Information about required captcha. If null, then no captcha is required. status. If it's PASSWORD_STATUS.REQUIRED then verifyPassword() needs to be called with the correct password before calling join()
Type: Object
The class that helps to control recording functions: start, stop, pause, resume, etc
Type: RecordingController
The class that helps to control recording functions: start, stop, pause, resume, etc
Type: ControlsOptionsManager
helper class for managing remote streams
Reason why TURN discovery is skipped.
Type: string
Add pre-fetched meeting info
The passed meeting info should be be complete, e.g.: fetched after password or captcha provided
(Object)
Complete meeting info
(FetchMeetingInfoParams)
Fetch parameters for validation
Promise<void>
:
Sets the self user policies based on the contents of the permission token
void
:
Removes references to local streams. This function should be called on cleanup when we leave the meeting etc.
void
:
This method stops receiving transcription for the current meeting
void
:
Handles ROAP_FAILURE event from the webrtc media connection
(Error)
void
:
Handles an incoming Roap message
(RoapMessage)
roap message
undefined
:
This function makes sure we send the right metrics when local and remote SDPs are processed/generated
undefined
:
Returns a promise that will resolve to fetch options for leaving a meeting.
This is to support quickly submitting a leave request when the browser/tab is closing. Calling meeting.leave will not work because there are some async steps that will not complete before the browser is closed. Instead, we pre-gather all the information/options needed for the request(s), and then simply and quickly fire the fetch(es) when pagehide is triggered.
We must use fetch instead of request because fetch has a keepalive option that allows the request it to outlive the page.
Note: the $timings values will be wrong, but setRequestTimingsAndFetch() will properly adjust them before submitting.
Promise
:
resolves to options to be used with fetch
Gets permission token expiry information including timeLeft, expiryTime, currentTime (from the time the function has been fired)
object
:
permissionTokenExpiryInfo
number
:
permissionTokenExpiryInfo.timeLeft The time left for token to expire
number
:
permissionTokenExpiryInfo.expiryTime The expiry time of permission token from the server
number
:
permissionTokenExpiryInfo.currentTime The current time of the local machine
Meeting State Change Event Emitted when ever there is a meeting state change
Type: Object
Meeting Ringing Event Emitted when this client should play a ringing sound, because this member is getting an incoming meeting or sending out an incoming meeting
Type: Object
Meeting Started Sharing Local Event Emitted when this member starts sharing
Type: Object
Meeting Stopped Sharing Local Event Emitted when this member stops sharing
Type: Object
Meeting Started Sharing Remote Event Emitted when remote sharing starts
Type: Object
Meeting Stopped Sharing Remote Event Emitted when remote screen sharing ends
Type: Object
Meeting Actions Update Event Emitted when a user can take actions on a meeting such as lock, unlock, assign host
Type: Object
Meeting Muted By Others Event Emitted when a member is muted by another member
Type: Object
Reconnection Starting Event Emitted when reconnection of media to the active meeting was successful
Messages are how people communicate in rooms. Each message timestamped and represented in Webex as a distinct block of content. Messages can contain plain text and a single file attachment. See the Message Attachments Guide for a list of supported media types.
Register to listen for incoming attachmentAction events
This is an alternate approach to registering for attachmentAction webhooks.
The events passed to any registered handlers will be similar to the webhook JSON,
but will omit webhook specific fields such as name, secret, url, etc.
The attachmentActions.listen() event objects can also include additional fields not
available in the webhook's JSON payload, specifically: inputs
.
To utilize the listen()
method, the authorization token used
will need to have spark:all
and spark:kms
scopes enabled.
Note that by configuring your application to enable or disable spark:all
via its configuration page will also enable or disable spark:kms
.
See the Sample App
for more details.
Promise
:
webex.attachmentActions.listen()
.then(() => {
console.log('listening to attachmentActions events');
webex.attachmentActions.on('created', (event) => console.log(`Got an attachmentActions:created event:\n${event}`));
})
.catch((e) => console.error(`Unable to register for attachmentAction events: ${e}`));
// Some app logic...
// WHen it is time to cleanup
webex.attachmentActions.stopListening();
webex.attachmentActions.off('created');
Register to listen for incoming messages events
This is an alternate approach to registering for messages webhooks.
The events passed to any registered handlers will be similar to the webhook JSON,
but will omit webhook specific fields such as name, secret, url, etc.
The messages.listen() event objects can also include additional fields not
available in the webhook's JSON payload: text
, markdown
, and files
.
These fields are available when their details are included in the web socket's
activity
object. Retrieving other fields, such as the html
field,
will require a manual request to get the corresponding message object.
To utilize the listen()
method, the authorization token used
will need to have spark:all
and spark:kms
scopes enabled.
Note that by configuring your application to enable or disable spark:all
via its configuration page will also enable or disable spark:kms
.
See the Sample App
for more details.
Promise
:
webex.messages.listen()
.then(() => {
console.log('listening to message events');
webex.messages.on('created', (event) => console.log(`Got a message:created event:\n${event}`));
webex.messages.on('deleted', (event) => console.log(`Got a message:deleted event:\n${event}`));
})
.catch((e) => console.error(`Unable to register for message events: ${e}`));
// Some app logic...
// When it is time to cleanup
webex.messages.stopListening();
webex.messages.off('created');
webex.messages.off('deleted');
Post a new message and/or media content into a room.
(MessageObject)
Promise<MessageObject>
:
webex.rooms.create({title: 'Create Message Example'})
.then(function(room) {
return webex.messages.create({
text: 'Howdy!',
roomId: room.id
});
})
.then(function(message) {
var assert = require('assert');
assert(message.id);
assert(message.personId);
assert(message.personEmail);
assert(message.roomId);
assert(message.created);
return 'success';
});
// => success
Put an updated message and/or media content into a room instead of existing message.
(MessageObject)
(MessageObject)
Promise<MessageObject>
:
webex.rooms.create({title: 'Create Message Example'})
.then(function(room) {
return webex.messages.create({
text: 'Howdy!',
roomId: room.id
});
})
.then(function(m) {
message = m;
return webex.messages.update(message,{markdown:`**What up**`});
})
.then(function(m) {
message = m;
return webex.messages.update(message.id,{roomId:message.roomId,text:'Howdy!'});
})
.then(function(message) {
var assert = require('assert');
assert(message.id);
assert(message.personId);
assert(message.personEmail);
assert(message.roomId);
assert(message.created);
return 'success';
});
// => success
Returns a single message.
((RoomObject | string))
Promise<MessageObject>
:
var message;
webex.rooms.create({title: 'Get Message Example'})
.then(function(room) {
return webex.messages.create({
text: 'Howdy!',
roomId: room.id
});
})
.then(function(m) {
message = m;
return webex.messages.get(message.id);
})
.then(function(message2) {
var assert = require('assert');
assert.deepEqual(message2, message);
return 'success';
});
// => success
Returns a list of messages. In most cases the results will only contain messages posted in rooms that the authenticated user is a member of.
Promise<Page<MessageObject>>
:
var message1, message2, room;
webex.rooms.create({title: 'List Messages Example'})
.then(function(r) {
room = r;
return webex.messages.create({
text: 'Howdy!',
roomId: room.id
});
})
.then(function(m) {
message1 = m;
return webex.messages.create({
text: 'How are you?',
roomId: room.id
});
})
.then(function(m) {
message2 = m;
return webex.messages.list({roomId: room.id});
})
.then(function(messages) {
var assert = require('assert');
assert.equal(messages.length, 2);
assert.equal(messages.items[0].id, message2.id);
assert.equal(messages.items[1].id, message1.id);
return 'success';
});
// => success
Deletes a single message. Deleting a message will notify all members of the room that the authenticated user deleted the message. Generally, users can only delete their own messages except for the case of Moderated Rooms and Org Administrators.
((MessageObject | uuid))
Promise
:
}
var message1, room;
webex.rooms.create({title: 'Messages Example'})
.then(function(r) {
room = r;
return webex.messages.create({
text: 'Howdy!',
roomId: room.id
});
})
.then(function(m) {
message1 = m;
return webex.messages.create({
text: 'How are you?',
roomId: room.id
});
})
.then(function() {
return webex.messages.remove(message1);
})
.then(function() {
return webex.messages.list({roomId: room.id});
})
.then(function(messages) {
var assert = require('assert');
assert.equal(messages.items.length, 1);
assert(messages.items[0].id !== message1.id);
return 'success';
});
// => success
These are the resources provided by Webex instances for interacting with our developer API
Memberships represent a person's relationship to a room. Use this API to list members of any room that you're in or create memberships to invite someone to a room. Memberships can also be updated to make someone a moderator or deleted to remove them from the room.
Register to listen for incoming membership events
This is an alternate approach to registering for membership webhooks.
The events passed to any registered handlers will be similar to the webhook JSON,
but will omit webhook specific fields such as name, secret, url, etc.
To utilize the listen()
method, the authorization token used
will need to have spark:all
and spark:kms
scopes enabled.
Note that by configuring your application to enable or disable spark:all
via its configuration page will also enable or disable spark:kms
.
See the Sample App
for more details.
Promise
:
webex.memberships.listen()
.then(() => {
console.log('listening to membership events');
webex.memberships.on('created', (event) => {
console.log(`Got a membership:created event:\n${event}`);
}
webex.memberships.on('updated', (event) => {
console.log(`Got a membership:updated event:\n${event}`);
}
webex.memberships.on('seen', (event) => {
// This represents a "read receipt" and will include a
// lastSeenId for the message this member has just "read",
// There is currently no equivalent webhook for this event.
console.log(`Got a membership:seen event:\n${event}`);
}
webex.memberships.on('deleted', (event) => => {
console.log(`Got a membership:created event:\n${event}`);
}
})
.catch((e) => console.error(`Unable to register for membership events: ${e}`));
// App logic goes here...
// Later when it is time to clean up
webex.memberships.stopListening();
webex.memberships.off('created');
webex.memberships.off('updated');
webex.memberships.off('seen');
webex.memberships.off('deleted');
Adds a person to a room. The person can be added by ID (personId
) or by
Email Address (personEmail
). The person can be optionally added to the room
as a moderator.
(MembershipObject)
Promise<MembershipObject>
:
webex.rooms.create({title: 'Create Membership Example'})
.then(function(room) {
return webex.memberships.create({
personEmail: 'alice@example.com',
roomId: room.id
});
})
.then(function(membership) {
var assert = require('assert');
assert(membership.id);
assert(membership.roomId);
assert(membership.personId);
assert(membership.personEmail);
assert('isModerator' in membership);
assert('isMonitor' in membership);
assert(membership.created);
return 'success';
});
// => success
Returns a single membership.
((MembershipObject | uuid))
Promise<MembershipObject>
:
var membership;
webex.rooms.create({title: 'Get Membership Example'})
.then(function(room) {
return webex.memberships.create({
personEmail: 'alice@example.com',
roomId: room.id
});
})
.then(function(m) {
membership = m;
return webex.memberships.get(m.id);
})
.then(function(m) {
var assert = require('assert');
assert.deepEqual(m, membership);
return 'success';
});
// => success
Returns a list of memberships. In most cases the results will only contain rooms that the authenticated user is a member of. You can filter the results by room to list people in a room or by person to find rooms that a specific person is a member of.
Promise<Page<MembershipObject>>
:
var room;
webex.rooms.create({title: 'List Membership Example'})
.then(function(r) {
room = r;
return webex.memberships.create({
personEmail: 'alice@example.com',
roomId: room.id
});
})
.then(function() {
return webex.memberships.list({roomId: room.id});
})
.then(function(memberships) {
var assert = require('assert');
assert.equal(memberships.length, 2);
for (var i = 0; i < memberships.length; i+= 1) {
assert.equal(memberships.items[i].roomId, room.id);
}
return 'success';
});
// => success
Returns a list of memberships with details about the lastSeenId for each user, allowing a client to indicate "read status" in a space GUI
This differs from the memberships.list() function in the following ways: -- it accepts only a room or object with a valid roomId -- no other options, eg: max, are considered -- results are not paginated -- memberships in the return do not include the "created", "isRoomHidden", fields -- memberships in the return do include the new "lastSeenId", and "lastSeenDate" fields these will not exist if the member has never "seen" the space
In general this function should be used only when the client needs to access read status info.
This function may be deprecated when this info is provided in the membership objects returned in the list function.
Promise<MembershipObjectList>
:
Deletes a single membership.
((MembershipObject | uuid))
Promise
:
var membership, room;
webex.rooms.create({title: 'Remove Membership Example'})
.then(function(r) {
room = r;
return webex.memberships.create({
personEmail: 'alice@example.com',
roomId: room.id
});
})
.then(function(m) {
membership = m;
return webex.memberships.list({roomId: room.id});
})
.then(function(memberships) {
var assert = require('assert');
assert.equal(memberships.length, 2);
return webex.memberships.remove(membership);
})
.then(function() {
return webex.memberships.list({roomId: room.id});
})
.then(function(memberships) {
var assert = require('assert');
assert.equal(memberships.length, 1);
return 'success';
});
// => success
Used to update a single membership's properties
((MembershipObject | uuid))
Promise<MembershipObject>
:
// Change membership to make user a moderator
var membership, room;
webex.rooms.create({title: 'Memberships Example'})
.then(function(r) {
room = r;
return webex.memberships.list({roomId: room.id});
})
.then(function(memberships) {
membership = memberships.items[0];
var assert = require('assert');
assert.equal(membership.isModerator, false);
membership.isModerator = true;
return webex.memberships.update(membership);
})
.then(function() {
return webex.memberships.get(membership.id);
})
.then(function(membership) {
var assert = require('assert');
assert.equal(membership.isModerator, true);
return 'success';
});
// => success
// Hide a one on one space
var assert = require('assert');
var membership, myId;
webex.people.get('me')
.then(function(person) {
myId = personId;
return webex.messages.create({
toPersonEmail: 'otherUser@acme.com',
text: 'This message will create a 1-1 space'
});
})
then(function(message) {
return webex.memberships.list({
roomId: message.roomId,
personId: myId
});
})
.then((memberships) => {
membership = memberships.items[0];
assert.equal(membership.isRoomHidden, false);
membership.isRoomHidden = true;
// This will generate a memberships:updated event
// that will only be seen by this user
return webex.memberships.update(membership);
})
.then(function(membership) {
assert.equal(membership.isRoomHidden, true);
return 'success';
});
// => success
Updates the lastSeenId attribute of a membership. Call this method to send a "read receipt" for a given message. This will update the lastSeenId for the user's membership in space where the message is.
(string)
Promise<MembershipObject>
:
Returns a single person by ID
((PersonObject | uuid | string))
Promise<PersonObject>
:
webex.rooms.create({title: 'Get Person Example'})
.then(function(room) {
return webex.memberships.create({
personEmail: 'alice@example.com',
roomId: room.id
});
})
.then(function(membership) {
return webex.people.get(membership.personId);
})
.then(function(alice) {
var assert = require('assert');
assert(alice.id);
assert(Array.isArray(alice.emails));
assert.equal(alice.emails.filter(function(email) {
return email === 'alice@example.com';
}).length, 1);
assert(alice.displayName);
assert(alice.created);
return 'success';
});
// => success
Returns a list of people
Name | Description |
---|---|
options.email email
|
Returns people with an email that contains this string |
options.displayName string
|
Returns people with a name that contains this string |
(bool)
optional flag that requires Hydra to send every type field,
even if the type is not "person" (e.g.: SX10, webhook_integration, etc.)
Promise<Page<PersonObject>>
:
var room;
webex.rooms.create({title: 'List People Example'})
.then(function(r) {
room = r;
return webex.memberships.create({
personEmail: 'alice@example.com',
roomId: room.id
});
})
.then(function() {
return webex.memberships.create({
personEmail: 'bob@example.com',
roomId: room.id
});
})
.then(function() {
return webex.people.list({email: 'alice@example.com'});
})
.then(function(people) {
var assert = require('assert');
assert.equal(people.length, 1);
var person = people.items[0];
assert(person.id);
assert(Array.isArray(person.emails));
assert(person.displayName);
assert(person.created);
return 'success';
});
// => success
Example usage of array method
var room;
var aliceId;
var bobId;
webex.rooms.create({title: 'List People Array Example'})
.then(function(r) {
room = r;
return webex.memberships.create({
personEmail: 'alice@example.com',
roomId: room.id
});
})
.then(function(membership) {
aliceId = membership.personId;
})
.then(function() {
return webex.memberships.create({
personEmail: 'bob@example.com',
roomId: room.id
});
})
.then(function(membership) {
bobId = membership.personId;
})
.then(function() {
return webex.people.list([aliceId, bobId]);
})
.then(function(people) {
var assert = require('assert');
assert.equal(people.length, 2);
var person = people.items[0];
assert(person.id);
assert(Array.isArray(person.emails));
assert(person.displayName);
assert(person.created);
return 'success';
});
// => success
Rooms are virtual meeting places for getting stuff done. This resource represents the room itself. Check out the Memberships API to learn how to add and remove people from rooms and the Messages API for posting and managing content.
Register to listen for incoming rooms events
This is an alternate approach to registering for rooms webhooks.
The events passed to any registered handlers will be similar to the webhook JSON,
but will omit webhook specific fields such as name, secret, url, etc.
To utilize the listen()
method, the authorization token used
will need to have spark:all
and spark:kms
scopes enabled.
Note that by configuring your application to enable or disable spark:all
via its configuration page will also enable or disable spark:kms
.
See the Sample App
for more details.
Promise
:
webex.rooms.listen()
.then(() => {
console.log('listening to room events');
webex.rooms.on('created', (event) => console.log(`Got a room:created event:\n${event}`);
webex.rooms.on('updated', (event) => console.log(`Got a room:updated event:\n${event}`);
})
.catch((e) => console.error(`Unable to register for room events: ${e}`));
// Some app logic...
// WHen it is time to cleanup
webex.rooms.stopListening();
webex.rooms.off('created');
webex.rooms.off('updated');
Creates a new room. The authenticated user is automatically added as a member of the room. See the Memberships API to learn how to add more people to the room.
(RoomObject)
Promise<RoomObject>
:
webex.rooms.create({title: 'Create Room Example'})
.then(function(room) {
var assert = require('assert')
assert(typeof room.created === 'string');
assert(typeof room.id === 'string');
assert(room.title === 'Create Room Example');
console.log(room.title);
return 'success';
});
// => success
Returns a single room.
((RoomObject | string))
(Object)
Promise<RoomObject>
:
var room;
webex.rooms.create({title: 'Get Room Example'})
.then(function(r) {
room = r
return webex.rooms.get(room.id)
})
.then(function(r) {
var assert = require('assert');
assert.deepEqual(r, room);
return 'success';
});
// => success
Returns a list of rooms. In most cases the results will only contain rooms that the authenticated user is a member of.
Promise<Page<RoomObject>>
:
var createdRooms;
Promise.all([
webex.rooms.create({title: 'List Rooms Example 1'}),
webex.rooms.create({title: 'List Rooms Example 2'}),
webex.rooms.create({title: 'List Rooms Example 3'})
])
.then(function(r) {
createdRooms = r;
return webex.rooms.list({max: 3})
.then(function(rooms) {
var assert = require('assert');
assert(rooms.length === 3);
for (var i = 0; i < rooms.items.length; i+= 1) {
assert(createdRooms.filter(function(room) {
return room.id === rooms.items[i].id;
}).length === 1);
}
return 'success';
});
});
// => success
Returns a list of rooms with details about the data of the last activity in the room, and the date of the users last presences in the room. The list is sorted with this with most recent activity first
For rooms where lastActivityDate > lastSeenDate the space can be considered to be "unread"
This differs from the rooms.list() function in the following ways: -- when called with no parameters it returns an array of all spaces, up to 1000, that the user is a member of -- pagination is not supported. ALL rooms are returned which can result in a large payload -- For users with hundreds of spaces, this API can take some time to to return, for this reason it supports an optional maxRecent parameter. If set this will return only the specified number of spaces with activity in the last two weeks. Recommended value is 30. Max supported is 100. -- only "id", "type", "lastActivityDate", and "lastSeenDate" are guaranteed to be available for each room in the list -- "title" is usually returned, but not guaranteed
In general this function should be used only when the client needs to access read status info, for example on startup. After startup, clients should track message and membership:seen events to maintain read status client side.
Since this API can take some time to return up to 1000 spaces, it is recommended that custom clients call this first with the maxRecent parameter set to 30, so that they can display some of the more recents spaces. Calling this API a second time with no parameters will return all the spaces.
Not all spaces may be returned, for example when users in more than 1000 spaces, or when a new spaces is added after this function is called, but before it returns. Custom clients should be prepared to gracefully handle cases where an event occurs in a space not returned by this call, by querying rooms.getWithReadStatus() with the id of the room in question
This function may be deprecated when this info is provided in the membership objects returned in the list function.
(int
= 0
)
Promise<RoomInfoObjectList>
:
Returns a single room object with details about the data of the last activity in the room, and the date of the users last presence in the room.
For rooms where lastActivityDate > lastSeenDate the room can be considered to be "unread"
This differs from the rooms.get() function in the following ways: -- it takes a single roomId parameter to fetch -- no other options are considered -- only "id", "type", "lastActivityDate", and "lastSeenDate" are guaranteed to be available in the return object -- "title" is usually returned, but not guaranteed
In general clients should use the listWithReadStatus() method on startup to get the initial roomStatus and then update their client side copy by responding to message, membership and room events.
This function allows a custom client to be "nimble" if it is responding to an event with a roomId that was not in the original fetch. The anticipated behavior is that getWithReadStats is called "just in time", with the resulting room object being added to the list of cached room objects on the client side.
This function may be deprecated when this info is provided in the room object returned in the get function.
(string)
Promise<RoomInfoObject>
:
Deletes a single room.
((RoomObject | string))
Promise
:
var room;
webex.rooms.create({title: 'Remove Room Example'})
.then(function(r) {
room = r;
return webex.rooms.remove(room.id);
})
.then(function() {
return webex.rooms.get(room.id);
})
.then(function() {
var assert = require('assert');
assert(false, 'the previous get should have failed');
})
.catch(function(reason) {
var assert = require('assert');
assert.equal(reason.statusCode, 404);
return 'success'
});
// => success
Used to update a single room's properties.
(RoomObject)
Promise<RoomObject>
:
var room;
webex.rooms.update({title: 'Update Room Example'})
.then(function(r) {
room = r;
room.title = 'Update Room Example (Updated Title)';
return webex.rooms.update(room);
})
.then(function() {
return webex.rooms.get(room.id);
})
.then(function(room) {
var assert = require('assert');
assert.equal(room.title, 'Update Room Example (Updated Title)');
return 'success';
});
// => success
Create a new team.
(TeamObject)
Promise<TeamObject>
:
webex.teams.create({name: 'Create Team Example'})
.then(function(team) {
var assert = require('assert');
assert(team.id);
assert(team.name);
assert(team.created);
return 'success';
});
// => success
Returns a single team
((TeamObject | string))
(Object)
Promise<TeamObject>
:
var team;
webex.teams.create({name: 'Get Team Example'})
.then(function(r) {
team = r;
return webex.teams.get(team.id);
})
.then(function(team2) {
var assert = require('assert');
assert.equal(team2.id, team.id);
return 'success';
});
// => success
List teams.
Promise<Page<TeamObject>>
:
var createdRooms;
Promise.all([
webex.teams.create({name: 'List Teams Example 1'}),
webex.teams.create({name: 'List Teams Example 2'}),
webex.teams.create({name: 'List Teams Example 3'})
])
.then(function(r) {
createdRooms = r;
return webex.teams.list({max: 3});
})
.then(function(teams) {
var assert = require('assert');
assert(teams.length === 3);
for (var i = 0; i < teams.items.length; i+= 1) {
assert(createdRooms.filter(function(room) {
return room.id === teams.items[i].id;
}).length === 1);
}
return 'success';
});
// => success
Update a team.
(TeamObject)
Promise<TeamObject>
:
var teams;
webex.teams.create({name: 'Update Team Example'})
.then(function(r) {
teams = r;
teams.name = 'Teams Example (Updated Title)';
return webex.teams.update(teams);
})
.then(function() {
return webex.teams.get(teams.id);
})
.then(function(teams) {
var assert = require('assert');
assert.equal(teams.name, 'Teams Example (Updated Title)');
return 'success';
});
// => success
Team Memberships represent a person's relationship to a team. Use this API to list members of any team that you're in or create memberships to invite someone to a team. Team memberships can also be updated to make someone a moderator or deleted to remove them from the team.
Just like in the Webex app, you must be a member of the team in order to list its memberships or invite people.
Add someone to a team by Person ID or email address; optionally making them a moderator.
(TeamMembershipObject)
Promise<TeamMembershipObject>
:
webex.teams.create({name: 'Create Team Membership Example'})
.then(function(team) {
return webex.teamMemberships.create({
personEmail: 'alice@example.com',
teamId: team.id
});
})
.then(function(membership) {
var assert = require('assert');
assert(membership.id);
assert(membership.teamId);
assert(membership.personId);
assert(membership.personEmail);
assert('isModerator' in membership);
assert(membership.created);
return 'success';
});
// => success
Get details for a membership by ID.
((TeamMembershipObject | string))
Promise<TeamMembershipObject>
:
var membership;
webex.teams.create({name: 'Get Team Memberships Example'})
.then(function(team) {
return webex.teamMemberships.create({
personEmail: 'alice@example.com',
teamId: team.id
});
})
.then(function(m) {
membership = m;
return webex.teamMemberships.get(m.id);
})
.then(function(m) {
var assert = require('assert');
assert.deepEqual(m, membership);
return 'success';
});
// => success
Lists all team memberships. By default, lists memberships for teams to which the authenticated user belongs.
[type]
:
var team;
webex.teams.create({name: 'List Team Memberships Example'})
.then(function(t) {
team = t;
return webex.teamMemberships.create({
personEmail: 'alice@example.com',
teamId: team.id
});
})
.then(function() {
return webex.teamMemberships.list({teamId: team.id});
})
.then(function(teamMemberships) {
var assert = require('assert');
assert.equal(teamMemberships.length, 2);
for (var i = 0; i < teamMemberships.length; i+= 1) {
assert.equal(teamMemberships.items[i].teamId, team.id);
}
return 'success';
});
// => success
Deletes a membership by ID.
((TeamMembershipObject | string))
Promise
:
var membership, team;
webex.teams.create({name: 'Remove Team Memberships Example'})
.then(function(t) {
team = t;
return webex.teamMemberships.create({
personEmail: 'alice@example.com',
teamId: team.id
});
})
.then(function(m) {
membership = m;
return webex.teamMemberships.list({teamId: team.id});
})
.then(function(teamMemberships) {
var assert = require('assert');
assert.equal(teamMemberships.length, 2);
return webex.teamMemberships.remove(membership);
})
.then(function() {
return webex.teamMemberships.list({teamId: team.id});
})
.then(function(teamMemberships) {
var assert = require('assert');
assert.equal(teamMemberships.length, 1);
return 'success';
});
// => success
Updates properties for a membership.
(TeamMembershipObject)
Promise<TeamMembershipObject>
:
Webhooks allow your app to be notified via HTTP when a specific event occurs on Webex. For example, your app can register a webhook to be notified when a new message is posted into a specific room.
Posts a webhook.
(WebhookObject)
Promise<Webhook>
:
webex.rooms.create({title: 'Create Webhook Example'})
.then(function(room) {
return webex.webhooks.create({
resource: 'messages',
event: 'created',
filter: 'roomId=' + room.id,
targetUrl: 'https://example.com/webhook',
name: 'Test Webhook'
});
})
.then(function(webhook) {
var assert = require('assert');
assert(webhook.id);
assert(webhook.resource);
assert(webhook.event);
assert(webhook.filter);
assert(webhook.targetUrl);
assert(webhook.name);
return 'success';
});
// => success
Shows details for a webhook.
((Webhook | string))
Promise<Webhook>
:
var webhook;
webex.rooms.create({title: 'Get Webhook Example'})
.then(function(room) {
return webex.webhooks.create({
resource: 'messages',
event: 'created',
filter: 'roomId=' + room.id,
targetUrl: 'https://example.com/webhook',
name: 'Test Webhook'
});
})
.then(function(w) {
webhook = w;
return webex.webhooks.get(webhook.id);
})
.then(function(webhook2) {
var assert = require('assert');
assert.deepEqual(webhook2, webhook);
return 'success';
});
// => success
Lists all webhooks.
(Object)
Name | Description |
---|---|
options.max integer
|
Limit the maximum number of webhooks in the response. |
Promise<Array<Webhook>>
:
var room, webhook;
webex.rooms.create({title: 'List Webhooks Example'})
.then(function(r) {
room = r;
return webex.webhooks.create({
resource: 'messages',
event: 'created',
filter: 'roomId=' + room.id,
targetUrl: 'https://example.com/webhook',
name: 'Test Webhook'
});
})
.then(function(w) {
webhook = w;
return webex.webhooks.list();
})
.then(function(webhooks) {
var assert = require('assert');
assert.equal(webhooks.items.filter(function(w) {
return w.id === webhook.id;
}).length, 1);
return 'success';
});
// => success
Delete a webhook.
((Webhook | string))
Promise
:
var room, webhook;
webex.rooms.create({title: 'Remove Webhook Example'})
.then(function(r) {
room = r;
return webex.webhooks.create({
resource: 'messages',
event: 'created',
filter: 'roomId=' + room.id,
targetUrl: 'https://example.com/webhook',
name: 'Test Webhook'
});
})
.then(function(w) {
webhook = w;
return webex.webhooks.remove(webhook);
})
.then(function() {
return webex.webhooks.list();
})
.then(function(webhooks) {
var assert = require('assert');
assert.equal(webhooks.items.filter(function(w) {
return w.id === webhook.id;
}).length, 0);
return 'success';
});
// => success
Update a webhook.
(Webhook)
Promise<Webhook>
:
var webhook;
webex.rooms.create({title: 'Webhook Example'})
.then(function(room) {
return webex.webhooks.create({
resource: 'messages',
event: 'created',
filter: 'roomId=' + room.id,
targetUrl: 'https://example.com/webhook',
name: 'Test Webhook'
});
})
.then(function(w) {
webhook = w;
webhook.targetUrl = 'https://example.com/webhook/newtarget';
return webex.webhooks.update(webhook);
})
.then(function() {
return webex.webhooks.get(webhook);
})
.then(function(webhook) {
var assert = require('assert');
assert.equal(webhook.targetUrl, 'https://example.com/webhook/newtarget');
return 'success';
});
// => success
Type: Object
(string?)
: Maximum log level that
should be printed to the console. One of
silent|error|warn|log|info|debug|trace
(number?)
: Maximum number of entries to store in the log buffer.
{
level: process.env.WEBEX_LOG_LEVEL,
historyLength: 1000
}
The following typedefs describes the responses of the various API calls.
Type: Object
(string)
: Unique identifier for the membership
(string)
: The room ID
(string)
: The person ID
(email)
: The email address of the person / room member
(boolean)
: Indicates whether the specified person should be a room moderator
(boolean)
: Indicates whether the specified member is a room monitor
(isoDate)
: The date and time that this membership was created
Type: Object
(string)
: (server generated) Unique identifier for the message
(string)
: The ID for the author of the message
(email)
: The email for the author of the message
(string)
: The ID for the room of the message
(string)
: The message posted to the room in plain text
(string)
: The message posted to the room in markdown
(Array<string>)
: The source URL(s) for the message attachment(s).
See the
Message Attachments
Guide for a list of supported media types.
(isoDate)
: (server generated) The date and time that the message was created
Type: Object
Type: Object
(string)
: (server generated) Unique identifier for the room
(string)
: The display name for the room. All room members
will see the title so make it something good
(string)
: (optional) The ID of the team to which the room
belongs
(isoDate)
: (server generated) The date and time that the
room was created
Type: Object
Type: Object
Type: Object
(string)
: (server generated) Unique identifier for the webhook
(string)
: The resource type for the webhook
(string)
: The event type for the webhook
(string)
: The filter that defines the webhook scope
(string)
: The URL that receives POST requests for each event
(string)
: A user-friendly name for this webhook
(string)
: (server generated) The date and time that the webhook was created
An email address, as a string.
Type: string
The date and time, specified in ISO 8601 extended offset date/time
format (e.g. 2015-10-18T14:26:16+00:00
).
Type: string
Type: Object
(string)
: (server generated) Unique identifier for the attachment action
(string)
: The ID of the message in which attachment action is to be performed
(string)
: The type of attachment action eg., submit
(Object)
: The inputs for form fields in attachment message
(string)
: (server generated) The ID for the author of the attachment action
(string)
: (server generated) The ID for the room of the message
(isoDate)
: (server generated) The date and time that the message was created
AttachmentActions are events that communicate information when a user clicks on an Action.Submit button in a card displayed in Webex Information conveyed in an AttachmentAction includes details about the user that clicked the button along with any card specific inputs. See the Attachments Actions API Documentation for more details
Post a new attachment action for a message with attachment.
(AttachmentActionObject)
Promise<AttachmentActionObject>
:
webex.rooms.create({title: 'Create Message with card Example'})
.then(function(room) {
return webex.messages.create({
text: 'Howdy!',
roomId: room.id,
attachments:[ {
contentType: 'application/vnd.microsoft.card.adaptive',
content: {
type: 'AdaptiveCard',
version: '1.0',
body: [
{
type: 'TextBlock',
text: '',
size: 'large'
},
{
type: 'TextBlock',
text: 'Adaptive Cards',
separation: 'none'
}
{
type: 'Input.Date',
id: 'dueDate'
}
],
actions: [
{
type: 'Action.Submit',
title: 'Due Date'
}
]
}
}]
});
})
.then(function(message) {
return webex.attachmentActions.create({
type: 'submit',
messageId: message.id,
inputs:{
dueDate: '26/06/1995'
}
})
.then(function(attachmentAction)){
var assert = require('assert');
assert(attachmentAction.id);
assert(attachmentAction.type);
assert(attachmentAction.personId);
assert(attachmentAction.inputs);
assert(attachmentAction.messageId);
assert(attachmentAction.roomId);
assert(attachmentAction.created);
return 'success';
}
});
// => success
Returns a single attachment action.
(string)
Promise<AttachmentActionObject>
:
var attachmentAction;
webex.rooms.create({title: 'Get Message Example'})
.then(function(room) {
return webex.messages.create({
text: 'Howdy!',
roomId: room.id,
attachments:[ {
contentType: 'application/vnd.microsoft.card.adaptive',
content: {
type: 'AdaptiveCard',
version: '1.0',
body: [
{
type: 'TextBlock',
text: '',
size: 'large'
},
{
type: 'TextBlock',
text: 'Adaptive Cards',
separation: 'none'
},
{
type: 'Input.Date',
id: 'dueDate'
}
],
actions: [
{
type: 'Action.Submit',
title: 'Due Date'
}
]
}
}]
});
})
.then(function(message) {
return webex.attachmentActions.create({
type: 'submit',
messageId: message.id,
inputs:{
dueDate: '26/06/1995'
});
})
.then(function(attachmentAction) {
return webex.attachmentActions.get(attachmentAction.id)
})
.then(function(attachmentAction){
var assert = require('assert');
assert.deepEqual(attachmentAction, attachmentAction);
return 'success';
})
// => success
Gets a list of all recent devices associated with the user the device list gets populated from Redis
Promise<Device>
:
Gets a list of all recent devices associated with the user the device list gets populated from Redis
Promise<Device>
:
Search for a device by name
Promise<Device>
:
Caches the device info and also registers to Redis for subsequent fetches
deviceInfo
:
Retreives device info of a particular device
(string)
Promise<deviceInfo>
:
Unregisters the device from Redis, will not fetch in subsequent loads, similar to space.deleteBinding()
(string)
Promise<deviceInfo>
:
Requests to display PIN on the device
Promise<deviceInfo>
:
pairs the device with the user (manual pairing), also adds it to user's recents list for subsequent fetches. similar to space.join()
Promise<deviceInfo>
:
unpairs the device with the user (manual/ultrasonic pairing), but still keeps in the recents list/does not remove from Redis options.removeAllDevices will remove all associated devices to user similar to space.leave()
Promise<deviceInfo>
:
binds the space to the paired device (if supported) similar to space.bindConversation()
Promise<deviceInfo>
:
unbinds the space to the paired device (if supported) similar to space.unbindConversation()
Promise<deviceInfo>
:
Gets the audio state of the paired device similar to device.getAudioState()
Promise<audioState>
:
Updates audio state of the paired device, should be called every 10 minutes or when mic or volume state is changed similar to device.putAudioState()
Promise<audioState>
:
Mutes paired device similar to device.mute()
Promise<audioState>
:
Unmutes paired device similar to device.unmute()
Promise<audioState>
:
Increases paired device's volume similar to device.increaseVolume()
Promise<audioState>
:
Decreases paired device's volume similar to device.decreaseVolume()
Promise<audioState>
:
Sets paired device's volume but should use increase and decrease api instead similar to device.setVolume()
(number
= 0
)
Promise<audioState>
:
Utility function to update decrypted device name on device object
(Array
= []
)
device
:
Utility function to update decrypted device name on device object
(object
= {}
)
device
:
Utility function to update device info on mercury updates
(object)
device
:
MediaDirection
Type: Object
MediaDirection
Type: Object
SendOptions
Type: Object
(Object)
Type: any
make a browser call to get the media
(SendOptions)
(Object)
SDK Configuration for meetings plugin
Promise
:
creates a webrtc media connection with provided tracks and mediaDirection configuration
(boolean)
(string)
string useful for debugging (will appear in media connection logs)
(string)
id for the meeting using this connection
(string)
id used in requests to correlate to this session
(Object)
Name | Description |
---|---|
options.mediaProperties Object?
|
contains mediaDirection and local tracks: audioTrack, videoTrack, shareVideoTrack, and shareAudioTrack |
options.remoteQualityLevel string?
|
LOW|MEDIUM|HIGH applicable only to non-multistream connections |
options.enableRtx boolean?
|
applicable only to non-multistream connections |
options.enableExtmap boolean?
|
applicable only to non-multistream connections |
options.turnServerInfo Object?
|
|
options.bundlePolicy BundlePolicy?
|
(RoapMediaConnection | MultistreamRoapMediaConnection)
:
generates share streams
(Object)
parameter
Name | Description |
---|---|
options.sendAudio Boolean
|
send audio from the display share |
options.sendShare Boolean
|
send video from the display share |
options.sharePreferences Object
|
|
options.sharePreferences.shareConstraints MediaTrackConstraints
|
constraints to apply to video |
options.sharePreferences.highFrameRate Boolean
|
if shareConstraints isn't provided, set default values based off of this boolean |
(Object
= {}
)
SDK Configuration for meetings plugin
Promise<MediaStream>
:
Toggle a specific stream noop as of now, does nothing
null
:
Stop input stream
(LocalStream)
A local stream
null
:
generates streams for audio video and share
(object)
parameter
Name | Description |
---|---|
mediaSetting.sendAudio Object
|
sendAudio: {Boolean} sendAudio constraints |
mediaSetting.sendVideo Object
|
sendVideo: {Boolean} sendVideo constraints |
mediaSetting.sendShare Object
|
sendShare: {Boolean} sendShare constraints |
mediaSetting.isSharing Object
|
isSharing: {Boolean} isSharing constraints |
(Object)
parameter
Name | Description |
---|---|
audioVideo.audio Object
|
{deviceId: {String}} |
audioVideo.video Object
|
{deviceId: {String}} |
(Object)
parameter
Name | Description |
---|---|
sharePreferences.shareConstraints Object
|
parameter |
sharePreferences.highFrameRate Boolean
|
parameter |
(Object)
SDK Config
Array
:
[localStream, shareStream]
Rtc Metrics
Array of MetricData items to be sent to the metrics service.
Check to see if the metrics queue has any items.
void
:
Clear the metrics interval.
void
:
Returns the current state of knowledge about whether we are on an ipv4-only or ipv6-only or mixed (ipv4 and ipv6) network. The return value matches the possible values of "ipver" parameter used by the backend APIs.
(Object)
webex instance
(IP_VERSION | undefined)
:
ipver value to be passed to the backend APIs or undefined if we should not pass any value to the backend
Returns options for leaving a meeting.
(any)
(any
= {}
)
any
:
leave options
Returns request options for leaving a meeting.
(any)
(any
= {}
)
any
:
request options
Adds the current locus sequence information to a request body
void
:
Updates the locus info for the meeting with the delta locus returned from requests that include the sequence information Returns the original response object
Object
:
Returns a CA-recognized error payload for the specified raw error message/reason.
New errors can be added to this function for handling in the future
(String)
the raw error message
Array<object>
:
an array of payload objects
null
:
Fetches meeting info from the server
(String)
one of many different types of destinations to look up info for
(DESTINATION_TYPE?
= null
)
to match up with the destination value
(String?
= null
)
meeting password
(Object?
= null
)
captcha code and id
(String?
= null
)
(String?
= null
)
(Object?
= {}
)
(Boolean?
= {}
)
meeting Id and whether Call Analyzer events should be sent
Promise
:
returns a meeting info object
Fetches meeting info from the server
(String)
one of many different types of destinations to look up info for
(DESTINATION_TYPE?
= null
)
to match up with the destination value
(String
= null
)
(String
= null
)
org ID of user's machine
(String
= null
)
(Object
= {}
)
(Object
= {}
)
Promise
:
returns a meeting info object
null
:
Fetches meeting info from the server
(String)
one of many different types of destinations to look up info for
(DESTINATION_TYPE?
= null
)
to match up with the destination value
(String?
= null
)
meeting password
(Object?
= null
)
captcha code and id
(String?
= null
)
(String?
= null
)
(Object?
= {}
)
(Boolean?
= {}
)
meeting Id and whether Call Analyzer events should be sent
Promise
:
returns a meeting info object
Fetches meeting info from the server
(String)
one of many different types of destinations to look up info for
(DESTINATION_TYPE?
= null
)
to match up with the destination value
(String
= null
)
(String
= null
)
org ID of user's machine
(String
= null
)
(Object
= {}
)
(Object
= {}
)
Promise
:
returns a meeting info object
(String)
ID of the meeting info you wish to retreive
MeetingInfo
:
returns a meeting info instance
(Object)
with format of {type: String, desintation: String}
where type is PERSONAL_ROOM, SIP_URI, CONVERSATION_URL, and destination is userId, sipUri, conversationUrl respectively
type can also be specified as an option and be of the list SIP_URI,MEETING_ID,LOCUS_ID,PERSONAL_ROOM,MEETING_LINK,ONE_ON_ONE,MEDIA_SIP_URI,CONVERSATION_URL,TEMP_SIP_URI
with the desination matching
Promise
:
returns a promise that resolves/rejects the result of the request
(Object)
with format of {type: String, desintation: String}
where type is PERSONAL_ROOM, SIP_URI, CONVERSATION_URL, and destination is userId, sipUri, conversationUrl respectively
type can also be specified as an option and be of the list SIP_URI,MEETING_ID,LOCUS_ID,PERSONAL_ROOM,MEETING_LINK,ONE_ON_ONE,MEDIA_SIP_URI,CONVERSATION_URL,TEMP_SIP_URI
with the desination matching
Promise
:
returns a promise that resolves/rejects the result of the request
Helper function to build up a correct locus url depending on the value passed
Object
:
returns an object with {resource, method}
Helper function to parse the webex site/host from a URI string.
String
:
the site/host part of the URI string (e.g. 'convergedats.webex.com')
Helper function to build up a correct locus url depending on the value passed
Object
:
returns an object with {resource, method}
Helper function to parse the webex site/host from a URI string.
String
:
the site/host part of the URI string (e.g. 'convergedats.webex.com')
(Object)
with format of {userId, passcode, meetingAddress, preferred}
Promise
:
returns a promise that resolves/rejects the result of the request
This is the type that matches what backend expects us to send to them. It is a bit weird, because it uses strings instead of booleans and numbers, but that's what they require.
Type:
{reachable: ("true"
| "false"
)?, latencyInMilliseconds: string?, clientMediaIPs: Array<string>?, untested: "true"
?}
Reachability results as an object in the format that backend expects
any
:
reachability results that need to be sent to the backend
Returns true only if ALL protocols (UDP, TCP and TLS) have been tested and none of the media clusters where reachable with any of the protocols. This is done irrespective of the config, so for example: if config.meetings.experimental.enableTlsReachability === false, it will return false, because TLS reachability won't be tested, so we can't say for sure that media backend is unreachable over TLS.
boolean
:
Sends a metric with all the statistics about how long reachability took
void
:
A class that handles reachability checks for a single cluster. It emits events from Events enum
Extends EventsScope
(string)
cluster name
(ClusterNode)
information about the media cluster
ClusterReachabilityResult
:
reachability result for this cluster
Aborts the cluster reachability checks by closing the peer connection
void
:
Converts a stun url to a turn url
(string)
url of a stun server
(("tcp"
| "udp"
))
what protocol to use for the turn server
string
:
url of a turn server
Converts a stun url to a turns url
(string)
url of a stun server
string
:
url of a turns server
Make a network request to join a meeting
(Object)
Name | Description |
---|---|
options.sipUri String
|
|
options.deviceUrl String
|
|
options.locusUrl String
|
|
options.resourceId String
|
, |
options.correlationId String
|
|
options.ensureConversation boolean
|
|
options.moderator boolean
|
|
options.pin boolean
|
|
options.moveToResource boolean
|
|
options.roapMessage Object
|
|
options.breakoutsSupported boolean
|
|
options.locale String
|
, |
options.deviceCapabilities Array
|
|
options.liveAnnotationSupported boolean
|
|
options.alias String
|
Promise
:
Sends a requests to get the latest locus DTO, it might be a full Locus or a delta, depending on the url provided
Promise
:
Prepares request options to to leave a meeting
Object
:
request options
change the content floor grant