- 03 Nov 2022
- 3 読む分
- 印刷する
- 闇光
- PDF
Apex API Reference
- 更新日 03 Nov 2022
- 3 読む分
- 印刷する
- 闇光
- PDF
Under the Hood
The ScreenMeet Apex API is a wrapper around a REST interface that makes callouts to the ScreenMeet REST API. The Apex wrapper takes care of things like authentication and message serialization for you automatically.
If you use the ScreenMeet API with any kind of synchronous code, such as Triggers or Flow Processes, you will need to add the @future(Callout=true) annotation to any helper functions which call methods from the ScreenMeet API. Read more about @future annotations here.
screenmeet.ScreenMeetAPI.ScreenMeetSessionParams
This object is used to define properties for a session which you are trying to either create or schedule.
Properties
Property | Type | Description |
---|---|---|
parentObject | Map<String, Object> | This map will contain properties describing the parent object. The constructor generates this object automatically. |
metaData | Map<String, Object> | This object contains extra metadata about the session request and stores data such as the version of the interface being used. This property is also auto-populated by the constructor. |
agentPrefs | ScreenMeetSessionAgentPrefs | This object contains the settings which the agent can toggle for this session. |
label | String | The label/description for this session. |
type | String (enum) | An enum that supports four values: support, cobrowse, live, and replay. |
externalMapping | String | This field is created automatically during construction. It acts as a globally unique identifier in the ScreenMeet system to determine which sessions are associated with the parent object. It will generally be a concatenation of the Organization Id and parentObjectId. |
startTime | String (ISO Date format) | This field contains the desired start time of this call and is only used for scheduled sessions. |
userDescription | String | The description of the user. Usually this will be the name of the agent who created the session. It will be shown to the end-user in support and co-browse sessions during the permission-consent process. |
Constructor
Property | Type | Description |
---|---|---|
sessionType | String (enum) | An enum that supports four values describing the type of session to create: support, cobrowse, live, and replay. |
parentObjectId | String | The Salesforce ID of the Object with which this session is to be associated. |
parentObjectType | String | The type of object with which this session is associated, e.g., case, opportunity, serviceappointment, and user. |
label | String | The label/description for this session. |
userDesc | String | The description of the user. Usually, this will be the name of the agent who created the session and will be shown to the end-user in support and co-browse sessions during the permission-consent process. |
Example Usage
Javascreenmeet.ScreenMeetAPI.ScreenMeetSessionParams newSessionParams = new screenmeet.ScreenMeetAPI.ScreenMeetSessionParams( 'live', //session type '5001R00000xgLmIQAU', //parentObjectId 'case', //owner object type UserInfo.getUserId(), //Logged in user ID 'My Support Session', //session description UserInfo.getName() //name of currently logged in USER );
screenmeet.ScreenMeetAPI.ScreenMeetSessionAgentPrefs
This object contains the settings which the agent can toggle for this session.
Property | Type | Description |
---|---|---|
record | Boolean | Whether or not the session should be recorded. |
knock | Boolean | Supported only by Live sessions. Indicates the Host must approve the attendee before joining. |
startwithrc | Boolean | Supported only by Remote Support sessions. Requests remote-control entitlement on start. |
startwithadmin | Boolean | Supported only by Remote Support sessions. Requests admin permissions to the device on start. |
Example Usage
Javascreenmeet.ScreenMeetAPI.ScreenMeetSessionAgentPrefs prefs = new screenmeet.ScreenMeetAPI.ScreenMeetSessionAgentPrefs(); prefs.record = true; prefs.startwithadmin = true; prefs.startwithrc = true; //set the agentPrefs of our session params object newSessionParams.agentPrefs = prefs;
Methods
createSession
This method is used to create a new session.
Signature
Map<String, Object> screenmeet.ScreenMeetApi.createSession(ScreenMeetSessionParams newSession)
Example
Javascreenmeet.ScreenMeetApi.createSession(newSessionParams);
scheduleSession
This method is used to schedule a session that starts in the future.
Signature
Map<String, Object> screenmeet.ScreenMeetApi.scheduleSession(ScreenMeetSessionParams newSession, string ISODateTime)
Example
Javascreenmeet.ScreenMeetApi.scheduleSession(myNewSessionParams, '2021-05-20T23:30:00.000Z');
rescheduleRemoteSession
This method is used to change the starting time of a previously scheduled session.
Signature
Map<String, Object> screenmeet.ScreenMeetApi.rescheduleRemoteSession(String SmSessionId, string ISODateTime)
Example
Javascreenmeet.ScreenMeetApi.rescheduleRemoteSession('gJ3Sjv6sXkrS', '2021-05-20T23:30:00.000Z');
closeRemoteSession
This method is used to close a session which is either scheduled, new, or active. If the session is active, all connected users will be dropped and the session will be closed.
Signature
Map<String, Object> screenmeet.ScreenMeetApi.closeRemoteSession(String SmSessionId);
Example
Javascreenmeet.ScreenMeetApi.closeRemoteSession('gJ3Sjv6sXkrS');
Putting it Together
The example below will create a ScreenMeet Live session with recording and knock to join enabled from a Case object record. You can call this in a Flow for any event:
//create the newSessionParams
screenmeet.ScreenMeetAPI.ScreenMeetSessionParams newSessionParams = new screenmeet.ScreenMeetAPI.ScreenMeetSessionParams(
'live', //session type
'5001R00000xgLmIQAU', //parentObjectId
'case', //owner object type
UserInfo.getUserId(), //Logged in user ID
'My Support Session', //session description
UserInfo.getName() //name of currently logged in USER
);
//configure agent user preferences (optional)
screenmeet.ScreenMeetAPI.ScreenMeetSessionAgentPrefs prefs = new screenmeet.ScreenMeetAPI.ScreenMeetSessionAgentPrefs();
prefs.record = true;
prefs.knock = true;
//set the agentPrefs of our session params object
newSessionParams.agentPrefs = prefs;
//make the REST API call to create the session
screenmeet.ScreenMeetApi.createSession(newSessionParams);