### postGuideVersionJobs Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/AIStudioApi.md Initiates the publishing process for a specific guide version. This action starts the job to make a guide version available. ```APIDOC ## POST /api/v2/guides/{guideId}/versions/{versionId}/jobs ### Description Start the publishing of a guide version. ### Method POST ### Endpoint /api/v2/guides/{guideId}/versions/{versionId}/jobs ### Parameters #### Path Parameters - **guideId** (String) - Required - The ID of the guide. - **versionId** (String) - Required - The ID of the guide version to publish. #### Request Body None ### Response #### Success Response (202) - **guideVersionJob** (GuideVersionJob) - Details about the initiated publishing job. #### Response Example ```json { "jobId": "string", "state": "Processing" } ``` ``` -------------------------------- ### Post Guides Uploads Example Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/AIStudioApi.md This snippet generates a presigned URL for uploading guide content. It requires an access token and accepts an empty query object. Custom headers can be provided for request context. ```javascript // Browser const platformClient = require('platformClient'); // Node const platformClient = require('purecloud-platform-client-v2'); // Manually set auth token or use loginImplicitGrant(...) or loginClientCredentialsGrant(...) or loginPKCEGrant(...) platformClient.ApiClient.instance.setAccessToken(yourAccessToken); let apiInstance = new platformClient.AIStudioApi(); let body = {}; // Object | query let opts = { 'customHeaders': { // Object. | Request Custom Headers 'X-Service-Name': 'customer-service', 'X-Request-ID': 'req-12345' } }; apiInstance.postGuidesUploads(body, opts) .then((data) => { console.log(`postGuidesUploads success! data: ${JSON.stringify(data, null, 2)}`); }) .catch((err) => { console.log('There was a failure calling postGuidesUploads'); console.error(err); }); ``` -------------------------------- ### Post Guides Jobs Example Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/AIStudioApi.md Use this snippet to initiate a guide generation job. Ensure you have set your access token and provide an empty body object. Custom headers can be included for service identification and request tracking. ```javascript // Browser const platformClient = require('platformClient'); // Node const platformClient = require('purecloud-platform-client-v2'); // Manually set auth token or use loginImplicitGrant(...) or loginClientCredentialsGrant(...) or loginPKCEGrant(...) platformClient.ApiClient.instance.setAccessToken(yourAccessToken); let apiInstance = new platformClient.AIStudioApi(); let body = {}; // Object | let opts = { 'customHeaders': { // Object. | Request Custom Headers 'X-Service-Name': 'customer-service', 'X-Request-ID': 'req-12345' } }; apiInstance.postGuidesJobs(body, opts) .then((data) => { console.log(`postGuidesJobs success! data: ${JSON.stringify(data, null, 2)}`); }) .catch((err) => { console.log('There was a failure calling postGuidesJobs'); console.error(err); }); ``` -------------------------------- ### Get All Guides with Filtering and Sorting Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/AIStudioApi.md Retrieves a list of all guides, supporting filtering by name, nameContains, and status, as well as sorting by dateModified, name, or status. It also supports pagination with pageNumber and pageSize. Requires 'aiStudio:guide:view' permission. The example demonstrates setting various options including custom headers. ```javascript // Browser const platformClient = require('platformClient'); // Node const platformClient = require('purecloud-platform-client-v2'); // Manually set auth token or use loginImplicitGrant(...) or loginClientCredentialsGrant(...) or loginPKCEGrant(...) platformClient.ApiClient.instance.setAccessToken(yourAccessToken); let apiInstance = new platformClient.AIStudioApi(); let opts = { 'name': "name_example", // String | Filter by matching name - case insensitive. 'nameContains': "nameContains_example", // String | Filter by name contains - case insensitive. 'status': "status_example", // String | Filter by status. 'sortBy': "dateModified", // String | Sort by. Default value dateModified. 'sortOrder': "desc", // String | Sort Order. Default value desc. 'pageNumber': 1, // Number | Page number. 'pageSize': 25, // Number | Page size. The maximum page size is 100. 'customHeaders': { // Object. | Request Custom Headers 'X-Service-Name': 'customer-service', 'X-Request-ID': 'req-12345' } }; apiInstance.getGuides(opts) .then((data) => { console.log(`getGuides success! data: ${JSON.stringify(data, null, 2)}`); }) .catch((err) => { console.log('There was a failure calling getGuides'); console.error(err); }); ``` -------------------------------- ### Update AI Studio Guide Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/AIStudioApi.md Updates an existing AI Studio guide. This example shows how to authenticate, instantiate the API client, and send a PATCH request to modify a guide. It includes optional custom headers for service identification and request tracking. Use this when you need to make changes to a guide's content or metadata. ```javascript // Browser const platformClient = require('platformClient'); // Node const platformClient = require('purecloud-platform-client-v2'); // Manually set auth token or use loginImplicitGrant(...) or loginClientCredentialsGrant(...) or loginPKCEGrant(...) platformClient.ApiClient.instance.setAccessToken(yourAccessToken); let apiInstance = new platformClient.AIStudioApi(); let guideId = "guideId_example"; // String | Guide ID let body = {}; // Object | let opts = { 'customHeaders': { // Object. | Request Custom Headers 'X-Service-Name': 'customer-service', 'X-Request-ID': 'req-12345' } }; apiInstance.patchGuide(guideId, body, opts) .then((data) => { console.log(`patchGuide success! data: ${JSON.stringify(data, null, 2)}`); }) .catch((err) => { console.log('There was a failure calling patchGuide'); console.error(err); }); ``` -------------------------------- ### Setup Encryption Key Configuration Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/RecordingApi.md Use this example to set up configurations for encryption key creation. The recording:encryptionKey:edit permission is required for this operation. ```javascript // Browser const platformClient = require('platformClient'); // Node const platformClient = require('purecloud-platform-client-v2'); // Manually set auth token or use loginImplicitGrant(...) or loginClientCredentialsGrant(...) or loginPKCEGrant(...) platformClient.ApiClient.instance.setAccessToken(yourAccessToken); let apiInstance = new platformClient.RecordingApi(); let body = {}; // Object | Encryption Configuration let opts = { 'customHeaders': { // Object. | Request Custom Headers 'X-Service-Name': 'customer-service', 'X-Request-ID': 'req-12345' } }; apiInstance.postRecordingKeyconfigurations(body, opts) .then((data) => { console.log(`postRecordingKeyconfigurations success! data: ${JSON.stringify(data, null, 2)}`); }) .catch((err) => { console.log('There was a failure calling postRecordingKeyconfigurations'); console.error(err); }); ``` -------------------------------- ### Get Guide by ID Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/AIStudioApi.md Retrieves a specific guide using its ID. Supports custom headers for request customization. Ensure you have the 'aiStudio:guide:view' permission. ```javascript // Browser const platformClient = require('platformClient'); // Node const platformClient = require('purecloud-platform-client-v2'); // Manually set auth token or use loginImplicitGrant(...) or loginClientCredentialsGrant(...) or loginPKCEGrant(...) platformClient.ApiClient.instance.setAccessToken(yourAccessToken); let apiInstance = new platformClient.AIStudioApi(); let guideId = "guideId_example"; // String | Guide ID let opts = { 'customHeaders': { // Object. | Request Custom Headers 'X-Service-Name': 'customer-service', 'X-Request-ID': 'req-12345' } }; apiInstance.getGuide(guideId, opts) .then((data) => { console.log(`getGuide success! data: ${JSON.stringify(data, null, 2)}`); }) .catch((err) => { console.log('There was a failure calling getGuide'); console.error(err); }); ``` -------------------------------- ### Get Guide Version by ID Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/AIStudioApi.md Fetches a specific version of a guide using its guide ID and version ID. Allows for custom request headers. Requires 'aiStudio:guideVersion:view' permission. ```javascript // Browser const platformClient = require('platformClient'); // Node const platformClient = require('purecloud-platform-client-v2'); // Manually set auth token or use loginImplicitGrant(...) or loginClientCredentialsGrant(...) or loginPKCEGrant(...) platformClient.ApiClient.instance.setAccessToken(yourAccessToken); let apiInstance = new platformClient.AIStudioApi(); let guideId = "guideId_example"; // String | Guide ID let versionId = "versionId_example"; // String | Version ID let opts = { 'customHeaders': { // Object. | Request Custom Headers 'X-Service-Name': 'customer-service', 'X-Request-ID': 'req-12345' } }; apiInstance.getGuideVersion(guideId, versionId, opts) .then((data) => { console.log(`getGuideVersion success! data: ${JSON.stringify(data, null, 2)}`); }) .catch((err) => { console.log('There was a failure calling getGuideVersion'); console.error(err); }); ``` -------------------------------- ### postGuidesJobs Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/AIStudioApi.md Starts a job to generate content for a guide. This is typically used after uploading content or making significant changes. ```APIDOC ## POST /api/v2/guides/jobs ### Description Start a guide content generation job. ### Method POST ### Endpoint /api/v2/guides/jobs ### Parameters None #### Request Body - **guideId** (String) - Required - The ID of the guide for which to generate content. ### Response #### Success Response (202) - **guideJob** (GuideJob) - Details about the initiated content generation job. #### Response Example ```json { "jobId": "string", "state": "Processing" } ``` ``` -------------------------------- ### Get User Development Activity Example Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/UsersApi.md Demonstrates how to fetch a specific user development activity by its ID and type. Includes optional custom headers for advanced requests. Ensure you have authenticated with a valid access token. ```javascript // Browser const platformClient = require('platformClient'); // Node const platformClient = require('purecloud-platform-client-v2'); // Manually set auth token or use loginImplicitGrant(...) or loginClientCredentialsGrant(...) or loginPKCEGrant(...) platformClient.ApiClient.instance.setAccessToken(yourAccessToken); let apiInstance = new platformClient.UsersApi(); let activityId = "activityId_example"; // String | Specifies the activity ID, maps to either assignment or appointment ID let type = "type_example"; // String | Specifies the activity type. Informational, AssessedContent and Assessment are deprecated let opts = { 'customHeaders': { // Object. | Request Custom Headers 'X-Service-Name': 'customer-service', 'X-Request-ID': 'req-12345' } }; apiInstance.getUsersDevelopmentActivity(activityId, type, opts) .then((data) => { console.log(`getUsersDevelopmentActivity success! data: ${JSON.stringify(data, null, 2)}`); }) .catch((err) => { console.log('There was a failure calling getUsersDevelopmentActivity'); console.error(err); }); ``` -------------------------------- ### Get Guide Version Job Status Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/AIStudioApi.md Retrieves the status of a publishing job for a specific guide version. Requires 'aiStudio:guideVersionJob:view' permission. The example shows how to set custom headers for the request. ```javascript // Browser const platformClient = require('platformClient'); // Node const platformClient = require('purecloud-platform-client-v2'); // Manually set auth token or use loginImplicitGrant(...) or loginClientCredentialsGrant(...) or loginPKCEGrant(...) platformClient.ApiClient.instance.setAccessToken(yourAccessToken); let apiInstance = new platformClient.AIStudioApi(); let guideId = "guideId_example"; // String | Guide ID let versionId = "versionId_example"; // String | Version ID let jobId = "jobId_example"; // String | jobId let opts = { 'customHeaders': { // Object. | Request Custom Headers 'X-Service-Name': 'customer-service', 'X-Request-ID': 'req-12345' } }; apiInstance.getGuideVersionJob(guideId, versionId, jobId, opts) .then((data) => { console.log(`getGuideVersionJob success! data: ${JSON.stringify(data, null, 2)}`); }) .catch((err) => { console.log('There was a failure calling getGuideVersionJob'); console.error(err); }); ``` -------------------------------- ### Get Routing Email Setup Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/RoutingApi.md Retrieves the email setup configuration. Supports custom headers. ```javascript // Browser const platformClient = require('platformClient'); // Node const platformClient = require('purecloud-platform-client-v2'); // Manually set auth token or use loginImplicitGrant(...) or loginClientCredentialsGrant(...) or loginPKCEGrant(...) platformClient.ApiClient.instance.setAccessToken(yourAccessToken); let apiInstance = new platformClient.RoutingApi(); let opts = { 'customHeaders': { // Object. | Request Custom Headers 'X-Service-Name': 'customer-service', 'X-Request-ID': 'req-12345' } }; apiInstance.getRoutingEmailSetup(opts) .then((data) => { console.log(`getRoutingEmailSetup success! data: ${JSON.stringify(data, null, 2)}`); }) .catch((err) => { console.log('There was a failure calling getRoutingEmailSetup'); console.error(err); }); ``` -------------------------------- ### getRoutingEmailSetup Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/RoutingApi.md Get email setup. ```APIDOC ## GET /api/v2/routing/email/setup ### Description Get email setup. ### Method GET ### Endpoint /api/v2/routing/email/setup ``` -------------------------------- ### Create Guide Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/AIStudioApi.md Creates a new guide. This operation requires the 'aiStudio:guide:add' permission. ```javascript // Browser const platformClient = require('platformClient'); // Node const platformClient = require('purecloud-platform-client-v2'); // Manually set auth token or use loginImplicitGrant(...) or loginClientCredentialsGrant(...) or loginPKCEGrant(...) platformClient.ApiClient.instance.setAccessToken(yourAccessToken); let apiInstance = new platformClient.AIStudioApi(); let body = {}; // Object | let opts = { 'customHeaders': { // Object. | Request Custom Headers 'X-Service-Name': 'customer-service', 'X-Request-ID': 'req-12345' } }; apiInstance.postGuides(body, opts) .then((data) => { console.log(`postGuides success! data: ${JSON.stringify(data, null, 2)}`); }) .catch((err) => { console.log('There was a failure calling postGuides'); console.error(err); }); ``` -------------------------------- ### JSON Configuration File Example Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/README.md Example of a configuration file in JSON format. This format supports the same settings as INI, including logging, reauthentication, and general SDK parameters. ```json { "logging": { "log_level": "trace", "log_format": "text", "log_to_console": false, "log_file_path": "/var/log/javascriptsdk.log", "log_response_body": false, "log_request_body": false }, "reauthentication": { "refresh_access_token": true, "refresh_token_wait_max": 10 }, "general": { "live_reload_config": true, "host": "https://api.mypurecloud.com" } } ``` -------------------------------- ### Create Guide Version Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/AIStudioApi.md Creates a new version of a guide. This operation requires the 'aiStudio:guideVersion:add' permission. ```javascript // Browser const platformClient = require('platformClient'); // Node const platformClient = require('purecloud-platform-client-v2'); // Manually set auth token or use loginImplicitGrant(...) or loginClientCredentialsGrant(...) or loginPKCEGrant(...) platformClient.ApiClient.instance.setAccessToken(yourAccessToken); let apiInstance = new platformClient.AIStudioApi(); let guideId = "guideId_example"; // String | Guide ID let opts = { 'body': {}, // Object | 'customHeaders': { // Object. | Request Custom Headers 'X-Service-Name': 'customer-service', 'X-Request-ID': 'req-12345' } }; apiInstance.postGuideVersions(guideId, opts) .then((data) => { console.log(`postGuideVersions success! data: ${JSON.stringify(data, null, 2)}`); }) .catch((err) => { console.log('There was a failure calling postGuideVersions'); console.error(err); }); ``` -------------------------------- ### Publish Script Example Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/ScriptsApi.md Example of how to publish a script using the ScriptsApi. This snippet demonstrates setting optional parameters like script data version, body, and custom headers. It shows both browser and Node.js initialization for the client. ```javascript // Browser const platformClient = require('platformClient'); // Node const platformClient = require('purecloud-platform-client-v2'); // Manually set auth token or use loginImplicitGrant(...) or loginClientCredentialsGrant(...) or loginPKCEGrant(...) platformClient.ApiClient.instance.setAccessToken(yourAccessToken); let apiInstance = new platformClient.ScriptsApi(); let opts = { 'scriptDataVersion': "scriptDataVersion_example", // String | Advanced usage - controls the data version of the script 'body': {}, // Object | body 'customHeaders': { // Object. | Request Custom Headers 'X-Service-Name': 'customer-service', 'X-Request-ID': 'req-12345' } }; apiInstance.postScriptsPublished(opts) .then((data) => { console.log(`postScriptsPublished success! data: ${JSON.stringify(data, null, 2)}`); }) .catch((err) => { console.log('There was a failure calling postScriptsPublished'); console.error(err); }); ``` -------------------------------- ### Get Guide Job by ID Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/AIStudioApi.md Retrieves the status of a guide deletion job using both guide and job IDs. Custom headers can be included. Requires 'aiStudio:guideJob:view' permission. ```javascript // Browser const platformClient = require('platformClient'); // Node const platformClient = require('purecloud-platform-client-v2'); // Manually set auth token or use loginImplicitGrant(...) or loginClientCredentialsGrant(...) or loginPKCEGrant(...) platformClient.ApiClient.instance.setAccessToken(yourAccessToken); let apiInstance = new platformClient.AIStudioApi(); let guideId = "guideId_example"; // String | Guide ID let jobId = "jobId_example"; // String | jobId let opts = { 'customHeaders': { // Object. | Request Custom Headers 'X-Service-Name': 'customer-service', 'X-Request-ID': 'req-12345' } }; apiInstance.getGuideJob(guideId, jobId, opts) .then((data) => { console.log(`getGuideJob success! data: ${JSON.stringify(data, null, 2)}`); }) .catch((err) => { console.log('There was a failure calling getGuideJob'); console.error(err); }); ``` -------------------------------- ### Query Case Plans - JavaScript Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/CaseManagementApi.md This example demonstrates how to query for case plans. It requires authentication and allows for custom headers to be passed with the request. ```javascript // Browser const platformClient = require('platformClient'); // Node const platformClient = require('purecloud-platform-client-v2'); // Manually set auth token or use loginImplicitGrant(...) or loginClientCredentialsGrant(...) or loginPKCEGrant(...) platformClient.ApiClient.instance.setAccessToken(yourAccessToken); let apiInstance = new platformClient.CaseManagementApi(); let body = {}; // Object | Caseplan query request. let opts = { 'customHeaders': { // Object. | Request Custom Headers 'X-Service-Name': 'customer-service', 'X-Request-ID': 'req-12345' } }; apiInstance.postCasemanagementCaseplansQuery(body, opts) .then((data) => { console.log(`postCasemanagementCaseplansQuery success! data: ${JSON.stringify(data, null, 2)}`); }) .catch((err) => { console.log('There was a failure calling postCasemanagementCaseplansQuery'); console.error(err); }); ``` -------------------------------- ### Get Telephony Edge Setup Package Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/TelephonyProvidersEdgeApi.md Retrieves the setup package for a locally deployed edge device. This is necessary to complete the virtual edge setup process. Requires ANY telephony:plugin:all permissions. Custom headers can be provided. ```javascript // Browser const platformClient = require('platformClient'); // Node const platformClient = require('purecloud-platform-client-v2'); // Manually set auth token or use loginImplicitGrant(...) or loginClientCredentialsGrant(...) or loginPKCEGrant(...) platformClient.ApiClient.instance.setAccessToken(yourAccessToken); let apiInstance = new platformClient.TelephonyProvidersEdgeApi(); let edgeId = "edgeId_example"; // String | Edge ID let opts = { 'customHeaders': { // Object. | Request Custom Headers 'X-Service-Name': 'customer-service', 'X-Request-ID': 'req-12345' } }; apiInstance.getTelephonyProvidersEdgeSetuppackage(edgeId, opts) .then((data) => { console.log(`getTelephonyProvidersEdgeSetuppackage success! data: ${JSON.stringify(data, null, 2)}`); }) .catch((err) => { console.log('There was a failure calling getTelephonyProvidersEdgeSetuppackage'); console.error(err); }); ``` -------------------------------- ### getTelephonyProvidersEdgeSetuppackage Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/TelephonyProvidersEdgeApi.md Get the setup package for a locally deployed edge device. This is needed to complete the setup process for the virtual edge. This endpoint is crucial for the initial configuration of virtual edge devices. ```APIDOC ## GET /api/v2/telephony/providers/edges/{edgeId}/setuppackage ### Description Get the setup package for a locally deployed edge device. This is needed to complete the setup process for the virtual edge. ### Method GET ### Endpoint /api/v2/telephony/providers/edges/{edgeId}/setuppackage ### Parameters #### Path Parameters - **edgeId** (string) - Required - The ID of the edge. ### Response #### Success Response (200) - **setupPackage** (object) - Description of the setup package object. ``` -------------------------------- ### Get SCIM Resource Type Example Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/SCIMApi.md Retrieves a specific SCIM resource type. Ensure you have set your authentication token before making the call. This example demonstrates setting custom headers. ```javascript const platformClient = require('platformClient'); // Node const platformClient = require('purecloud-platform-client-v2'); // Manually set auth token or use loginImplicitGrant(...) or loginClient\CredentialsGrant(...) or loginPKCEGrant(...) platformClient.ApiClient.instance.setAccessToken(yourAccessToken); let apiInstance = new platformClient.SCIMApi(); let resourceType = "resourceType_example"; // String | The type of resource. Returned with GET /api/v2/scim/resourcetypes. let opts = { 'customHeaders': { // Object. | Request Custom Headers 'X-Service-Name': 'customer-service', 'X-Request-ID': 'req-12345' } }; apiInstance.getScimResourcetype(resourceType, opts) .then((data) => { console.log(`getScimResourcetype success! data: ${JSON.stringify(data, null, 2)}`); }) .catch((err) => { console.log('There was a failure calling getScimResourcetype'); console.error(err); }); ``` -------------------------------- ### INI Configuration File Example Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/README.md Example of a configuration file in INI format. This format supports settings for logging, reauthentication, and general SDK behavior. ```ini [logging] log_level = trace log_format = text log_to_console = false log_file_path = /var/log/javascriptsdk.log log_response_body = false log_request_body = false [reauthentication] refresh_access_token = true refresh_token_wait_max = 10 [general] live_reload_config = true host = https://api.mypurecloud.com ``` -------------------------------- ### Install Platform Client SDK for Node.js Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/README.md Install the SDK using npm for Node.js applications. ```sh npm install purecloud-platform-client-v2 ``` -------------------------------- ### Create Supported Content Profile Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/ConversationsApi.md This example demonstrates how to create a Supported Content profile. It requires 'messaging:supportedContent:add' permissions and allows for custom request headers. ```javascript // Browser const platformClient = require('platformClient'); // Node const platformClient = require('purecloud-platform-client-v2'); // Manually set auth token or use loginImplicitGrant(...) or loginClientCredentialsGrant(...) or loginPKCEGrant(...) platformClient.ApiClient.instance.setAccessToken(yourAccessToken); let apiInstance = new platformClient.ConversationsApi(); let body = {}; // Object | SupportedContent let opts = { 'customHeaders': { // Object. | Request Custom Headers 'X-Service-Name': 'customer-service', 'X-Request-ID': 'req-12345' } }; apiInstance.postConversationsMessagingSupportedcontent(body, opts) .then((data) => { console.log(`postConversationsMessagingSupportedcontent success! data: ${JSON.stringify(data, null, 2)}`); }) .catch((err) => { console.log('There was a failure calling postConversationsMessagingSupportedcontent'); console.error(err); }); ``` -------------------------------- ### Get Users Query with Options Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/UsersApi.md Demonstrates how to retrieve a list of users using the getUsersQuery method. Includes examples for setting various options like cursor, pageSize, sortOrder, expand, integrationPresenceSource, userCustomAttributeSchemaIds, state, and customHeaders. Note that expand parameters are best-effort and specific API requests might be more reliable for guaranteed information. The integrationPresenceSource parameter limits the user count to 100. ```javascript // Browser const platformClient = require('platformClient'); // Node const platformClient = require('purecloud-platform-client-v2'); // Manually set auth token or use loginImplicitGrant(...) or loginClientCredentialsGrant(...) or loginPKCEGrant(...) platformClient.ApiClient.instance.setAccessToken(yourAccessToken); let apiInstance = new platformClient.UsersApi(); let opts = { 'cursor': "cursor_example", // String | Cursor token to retrieve next page 'pageSize': 25, // Number | Page size 'sortOrder': "ASC", // String | Ascending or descending sort order 'expand': ["expand_example"], // [String] | Which fields, if any, to expand. Note, expand parameters are resolved with a best effort approach and not guaranteed to be returned. If requested expand information is absolutely required, it's recommended to use specific API requests instead. 'integrationPresenceSource': "integrationPresenceSource_example", // String | Gets an integration presence for users instead of their defaults. This parameter will only be used when presence is provided as an expand. When using this parameter the maximum number of users that can be returned is 100. 'userCustomAttributeSchemaIds': ["userCustomAttributeSchemaIds_example"], // [String] | Gets custom user attribute values for given schemas set for user. This parameter will only be used when customAttributes is provided as an expand. The maximum number of schemaIds that can be requested is 5 'state': "active", // String | Only list users of this state 'customHeaders': { // Object. | Request Custom Headers 'X-Service-Name': 'customer-service', 'X-Request-ID': 'req-12345' } }; apiInstance.getUsersQuery(opts) .then((data) => { console.log(`getUsersQuery success! data: ${JSON.stringify(data, null, 2)}`); }) .catch((err) => { console.log('There was a failure calling getUsersQuery'); console.error(err); }); ``` -------------------------------- ### getArchitectIvr Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/ArchitectApi.md Get an IVR configuration by its ID. This endpoint retrieves the full details of a specific IVR setup. ```APIDOC ## GET /api/v2/architect/ivrs/{ivrId} ### Description Get an IVR config. ### Method GET ### Endpoint /api/v2/architect/ivrs/{ivrId} ### Parameters #### Path Parameters - **ivrId** (string) - Required - The ID of the IVR to retrieve. ``` -------------------------------- ### postArchitectSystempromptResourceUploads Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/ArchitectApi.md Creates a presigned URL for uploading a system prompt file. ```APIDOC ## POST /api/v2/architect/systemprompts/{promptId}/resources/{languageCode}/uploads ### Description Creates a presigned URL for uploading a system prompt file. ### Method POST ### Endpoint /api/v2/architect/systemprompts/{promptId}/resources/{languageCode}/uploads ### Parameters #### Path Parameters - **promptId** (string) - Required - The ID of the system prompt. - **languageCode** (string) - Required - The language code for the resource. ### Response #### Success Response (200) - **uploadURI** (string) - The presigned URL for uploading the file. - **uploadHeaders** (object) - Headers required for the upload request. ``` -------------------------------- ### Get OAuth Authorization Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/OAuthApi.md Retrieves a client authorized by the resource owner. Requires the 'oauth:client:authorize' permission. The example demonstrates setting up the SDK and making the GET request with optional language and custom headers. ```javascript // Browser const platformClient = require('platformClient'); // Node const platformClient = require('purecloud-platform-client-v2'); // Manually set auth token or use loginImplicitGrant(...) or loginClientCredentialsGrant(...) or loginPKCEGrant(...) platformClient.ApiClient.instance.setAccessToken(yourAccessToken); let apiInstance = new platformClient.OAuthApi(); let clientId = "clientId_example"; // String | The ID of client let opts = { 'acceptLanguage': "en-us", // String | The language in which to display the client descriptions. 'customHeaders': { // Object. | Request Custom Headers 'X-Service-Name': 'customer-service', 'X-Request-ID': 'req-12345' } }; apiInstance.getOauthAuthorization(clientId, opts) .then((data) => { console.log(`getOauthAuthorization success! data: ${JSON.stringify(data, null, 2)}`); }) .catch((err) => { console.log('There was a failure calling getOauthAuthorization'); console.error(err); }); ``` -------------------------------- ### Publish Caseplan Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/CaseManagementApi.md This example shows how to publish a case plan. It requires the case plan ID and optionally accepts custom headers. Ensure authentication is configured. ```javascript // Browser const platformClient = require('platformClient'); // Node const platformClient = require('purecloud-platform-client-v2'); // Manually set auth token or use loginImplicitGrant(...) or loginClientCredentialsGrant(...) or loginPKCEGrant(...) platformClient.ApiClient.instance.setAccessToken(yourAccessToken); let apiInstance = new platformClient.CaseManagementApi(); let caseplanId = "caseplanId_example"; // String | Caseplan identifier. let opts = { 'customHeaders': { // Object. | Request Custom Headers 'X-Service-Name': 'customer-service', 'X-Request-ID': 'req-12345' } }; apiInstance.postCasemanagementCaseplanPublish(caseplanId, opts) .then((data) => { console.log(`postCasemanagementCaseplanPublish success! data: ${JSON.stringify(data, null, 2)}`); }) .catch((err) => { console.log('There was a failure calling postCasemanagementCaseplanPublish'); console.error(err); }); ``` -------------------------------- ### Get AI Studio Guide Job Status Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/AIStudioApi.md Retrieves the status of a specific AI Studio guide generation job. This snippet demonstrates how to set up the client, authenticate, and make the API call, including handling success and error responses. It is useful for monitoring the progress of asynchronous guide generation tasks. ```javascript // Browser const platformClient = require('platformClient'); // Node const platformClient = require('purecloud-platform-client-v2'); // Manually set auth token or use loginImplicitGrant(...) or loginClientCredentialsGrant(...) or loginPKCEGrant(...) platformClient.ApiClient.instance.setAccessToken(yourAccessToken); let apiInstance = new platformClient.AIStudioApi(); let jobId = "jobId_example"; // String | jobId let opts = { 'customHeaders': { // Object. | Request Custom Headers 'X-Service-Name': 'customer-service', 'X-Request-ID': 'req-12345' } }; apiInstance.getGuidesJob(jobId, opts) .then((data) => { console.log(`getGuidesJob success! data: ${JSON.stringify(data, null, 2)}`); }) .catch((err) => { console.log('There was a failure calling getGuidesJob'); console.error(err); }); ``` -------------------------------- ### postArchitectSystempromptResources Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/ArchitectApi.md Create system prompt resource override. ```APIDOC ## POST /api/v2/architect/systemprompts/{promptId}/resources ### Description Create system prompt resource override. ### Method POST ### Endpoint /api/v2/architect/systemprompts/{promptId}/resources ### Parameters #### Path Parameters - **promptId** (string) - Required - The ID of the system prompt. ``` -------------------------------- ### getTelephonyProvidersEdgeSoftwareversions Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/TelephonyProvidersEdgeApi.md Gets all the available software versions for this edge. This endpoint lists all compatible software versions that can be installed on an edge device. ```APIDOC ## GET /api/v2/telephony/providers/edges/{edgeId}/softwareversions ### Description Gets all the available software versions for this edge. ### Method GET ### Endpoint /api/v2/telephony/providers/edges/{edgeId}/softwareversions ### Parameters #### Path Parameters - **edgeId** (string) - Required - The ID of the edge. ### Response #### Success Response (200) - **softwareVersions** (array) - A list of available software version objects. ``` -------------------------------- ### Query Adherence Explanations Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/WorkforceManagementApi.md Query adherence explanations for the current user. This example demonstrates how to set optional parameters like forceAsync and customHeaders. ```javascript // Browser const platformClient = require('platformClient'); // Node const platformClient = require('purecloud-platform-client-v2'); // Manually set auth token or use loginImplicitGrant(...) or loginClientCredentialsGrant(...) or loginPKCEGrant(...) platformClient.ApiClient.instance.setAccessToken(yourAccessToken); let apiInstance = new platformClient.WorkforceManagementApi(); let body = {}; // Object | The request body let opts = { 'forceAsync': true, // Boolean | Force the result of this operation to be sent asynchronously via notification. For testing/app development purposes 'forceDownloadService': true, // Boolean | Force the result of this operation to be sent via download service. For testing/app development purposes 'customHeaders': { // Object. | Request Custom Headers 'X-Service-Name': 'customer-service', 'X-Request-ID': 'req-12345' } }; apiInstance.postWorkforcemanagementAdherenceExplanationsQuery(body, opts) .then((data) => { console.log(`postWorkforcemanagementAdherenceExplanationsQuery success! data: ${JSON.stringify(data, null, 2)}`); }) .catch((err) => { console.log('There was a failure calling postWorkforcemanagementAdherenceExplanationsQuery'); console.error(err); }); ``` -------------------------------- ### JSON Gateway Configuration Example Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/README.md Example of a JSON configuration file with gateway settings. This enables routing traffic through a gateway, specifying host, protocol, port, and path parameters for login and API requests. ```json { "logging": { "log_level": "trace", "log_format": "text", "log_to_console": false, "log_file_path": "/var/log/javascriptsdk.log", "log_response_body": false, "log_request_body": false }, "reauthentication": { "refresh_access_token": true, "refresh_token_wait_max": 10 }, "general": { "live_reload_config": true, "host": "https://api.mypurecloud.com" }, "gateway": { "host": "mygateway.mydomain.myextension", "protocol": "https", "port": 1443, "path_params_login": "myadditionalpathforlogin", "path_params_api": "myadditionalpathforapi", "username": "username", "password": "password" } } ``` -------------------------------- ### getFlowVersionConfiguration Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/ArchitectApi.md Gets the configuration details for a specific version of a flow. This is essential for understanding the exact setup of a particular flow version. ```APIDOC ## GET /api/v2/flows/{flowId}/versions/{versionId}/configuration ### Description Retrieves the configuration for a specific flow version. ### Method GET ### Endpoint /api/v2/flows/{flowId}/versions/{versionId}/configuration ### Parameters #### Path Parameters - **flowId** (string) - Required - The ID of the flow. - **versionId** (string) - Required - The ID of the flow version. ``` -------------------------------- ### Get Execution Data Settings Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/SettingsApi.md Retrieves the execution history enabled setting. This snippet includes an example of how to pass custom headers. ```javascript // Browser const platformClient = require('platformClient'); // Node const platformClient = require('purecloud-platform-client-v2'); // Manually set auth token or use loginImplicitGrant(...) or loginClientCredentialsGrant(...) or loginPKCEGrant(...) platformClient.ApiClient.instance.setAccessToken(yourAccessToken); let apiInstance = new platformClient.SettingsApi(); let opts = { 'customHeaders': { // Object. | Request Custom Headers 'X-Service-Name': 'customer-service', 'X-Request-ID': 'req-12345' } }; apiInstance.getSettingsExecutiondata(opts) .then((data) => { console.log(`getSettingsExecutiondata success! data: ${JSON.stringify(data, null, 2)}`); }) .catch((err) => { console.log('There was a failure calling getSettingsExecutiondata'); console.error(err); }); ``` -------------------------------- ### postOutboundCampaignStart Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/OutboundApi.md Starts a specified campaign. This action requires the 'outbound:campaign:start' permission. ```APIDOC ## POST /api/v2/outbound/campaigns/{campaignId}/start ### Description Start the campaign. ### Method POST ### Endpoint /api/v2/outbound/campaigns/{campaignId}/start ### Parameters #### Path Parameters - **campaignId** (String) - Required - Campaign ID #### Request Body This endpoint does not accept a request body. ### Response #### Success Response (200) void (no response body) ### Permissions Requires ANY permissions: * outbound:campaign:start ``` -------------------------------- ### Create Skill Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/RoutingApi.md This example shows how to create a new routing skill. It requires 'routing:skill:manage' or 'routing:skill:create' permissions. Optional custom headers can be provided. ```javascript // Browser const platformClient = require('platformClient'); // Node const platformClient = require('purecloud-platform-client-v2'); // Manually set auth token or use loginImplicitGrant(...) or loginClientCredentialsGrant(...) or loginPKCEGrant(...) platformClient.ApiClient.instance.setAccessToken(yourAccessToken); let apiInstance = new platformClient.RoutingApi(); let body = {}; // Object | Skill let opts = { 'customHeaders': { // Object. | Request Custom Headers 'X-Service-Name': 'customer-service', 'X-Request-ID': 'req-12345' } }; apiInstance.postRoutingSkills(body, opts) .then((data) => { console.log(`postRoutingSkills success! data: ${JSON.stringify(data, null, 2)}`); }) .catch((err) => { console.log('There was a failure calling postRoutingSkills'); console.error(err); }); ``` -------------------------------- ### Get External Contacts Settings Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/SettingsApi.md Retrieves the external contacts settings. This example demonstrates setting custom headers for the API request. ```javascript // Browser const platformClient = require('platformClient'); // Node const platformClient = require('purecloud-platform-client-v2'); // Manually set auth token or use loginImplicitGrant(...) or loginClientCredentialsGrant(...) or loginPKCEGrant(...) platformClient.ApiClient.instance.setAccessToken(yourAccessToken); let apiInstance = new platformClient.SettingsApi(); let opts = { 'customHeaders': { // Object. | Request Custom Headers 'X-Service-Name': 'customer-service', 'X-Request-ID': 'req-12345' } }; apiInstance.getExternalcontactsSettings(opts) .then((data) => { console.log(`getExternalcontactsSettings success! data: ${JSON.stringify(data, null, 2)}`); }) .catch((err) => { console.log('There was a failure calling getExternalcontactsSettings'); console.error(err); }); ``` -------------------------------- ### Get Integrations Actions Functions Runtimes Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/IntegrationsApi.md Retrieves a list of function runtimes for integrations. This example shows how to set custom headers for the request. ```javascript // Browser const platformClient = require('platformClient'); // Node const platformClient = require('purecloud-platform-client-v2'); // Manually set auth token or use loginImplicitGrant(...) or loginClientCredentialsGrant(...) or loginPKCEGrant(...) platformClient.ApiClient.instance.setAccessToken(yourAccessToken); let apiInstance = new platformClient.IntegrationsApi(); let opts = { 'customHeaders': { // Object. | Request Custom Headers 'X-Service-Name': 'customer-service', 'X-Request-ID': 'req-12345' } }; apiInstance.getIntegrationsActionsFunctionsRuntimes(opts) .then((data) => { console.log(`getIntegrationsActionsFunctionsRuntimes success! data: ${JSON.stringify(data, null, 2)}`); }) .catch((err) => { console.log('There was a failure calling getIntegrationsActionsFunctionsRuntimes'); console.error(err); }); ``` -------------------------------- ### postRecordingKeyconfigurations Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/RecordingApi.md Setup configurations for encryption key creation. ```APIDOC ## POST /api/v2/recording/keyconfigurations ### Description Setup configurations for encryption key creation. ### Method POST ### Endpoint /api/v2/recording/keyconfigurations ``` -------------------------------- ### postLearningModuleJobs Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/LearningApi.md Start a specified operation on a learning module. ```APIDOC ## POST /api/v2/learning/modules/{moduleId}/jobs ### Description Starts a specified operation on a learning module. ### Method POST ### Endpoint /api/v2/learning/modules/{moduleId}/jobs ### Parameters #### Path Parameters - **moduleId** (string) - Required - The ID of the module. #### Request Body - **body** (object) - Required - The operation details. ``` -------------------------------- ### Get Group Default Greetings Source: https://github.com/mypurecloud/platform-client-sdk-javascript/blob/master/build/docs/GreetingsApi.md Fetches the default greetings for a given group ID. Includes an example of passing custom request headers. ```javascript // Browser const platformClient = require('platformClient'); // Node const platformClient = require('purecloud-platform-client-v2'); // Manually set auth token or use loginImplicitGrant(...) or loginClientCredentialsGrant(...) or loginPKCEGrant(...) platformClient.ApiClient.instance.setAccessToken(yourAccessToken); let apiInstance = new platformClient.GreetingsApi(); let groupId = "groupId_example"; // String | Group ID let opts = { 'customHeaders': { // Object. | Request Custom Headers 'X-Service-Name': 'customer-service', 'X-Request-ID': 'req-12345' } }; apiInstance.getGroupGreetingsDefaults(groupId, opts) .then((data) => { console.log(`getGroupGreetingsDefaults success! data: ${JSON.stringify(data, null, 2)}`); }) .catch((err) => { console.log('There was a failure calling getGroupGreetingsDefaults'); console.error(err); }); ```