Skip to content

Latest commit

 

History

History
238 lines (150 loc) · 6.8 KB

SwitchboardsApi.md

File metadata and controls

238 lines (150 loc) · 6.8 KB

SunshineConversationsClient.SwitchboardsApi

All URIs are relative to https://api.smooch.io

Method HTTP request Description
createSwitchboard POST /v2/apps/{appId}/switchboards Create Switchboard
deleteSwitchboard DELETE /v2/apps/{appId}/switchboards/{switchboardId} Delete Switchboard
listSwitchboards GET /v2/apps/{appId}/switchboards List Switchboards
updateSwitchboard PATCH /v2/apps/{appId}/switchboards/{switchboardId} Update Switchboard

createSwitchboard

SwitchboardResponse createSwitchboard(appId)

Create Switchboard

Create a switchboard.

Example

var SunshineConversationsClient = require('sunshine-conversations-client');
var defaultClient = SunshineConversationsClient.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR_USERNAME';
basicAuth.password = 'YOUR_PASSWORD';

// Uncomment this section to use JWTs instead
// var bearerAuth = defaultClient.authentications['bearerAuth'];
// bearerAuth.accessToken = 'YOUR_ACCESS_TOKEN';

var apiInstance = new SunshineConversationsClient.SwitchboardsApi();
var appId = "5d8cff3cd55b040010928b5b"; // String | Identifies the app.
apiInstance.createSwitchboard(appId).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
appId String Identifies the app.

Return type

SwitchboardResponse

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

deleteSwitchboard

Object deleteSwitchboard(appId, switchboardId)

Delete Switchboard

Deletes the switchboard and all its switchboard integrations. The integrations linked to these switchboard integrations are not deleted and will start receiving all conversation events.

Example

var SunshineConversationsClient = require('sunshine-conversations-client');
var defaultClient = SunshineConversationsClient.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR_USERNAME';
basicAuth.password = 'YOUR_PASSWORD';

// Uncomment this section to use JWTs instead
// var bearerAuth = defaultClient.authentications['bearerAuth'];
// bearerAuth.accessToken = 'YOUR_ACCESS_TOKEN';

var apiInstance = new SunshineConversationsClient.SwitchboardsApi();
var appId = "5d8cff3cd55b040010928b5b"; // String | Identifies the app.
var switchboardId = "5d8cff3cd55b040010928b5b"; // String | Identifies the switchboard.
apiInstance.deleteSwitchboard(appId, switchboardId).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
appId String Identifies the app.
switchboardId String Identifies the switchboard.

Return type

Object

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

listSwitchboards

SwitchboardListResponse listSwitchboards(appId)

List Switchboards

Lists all switchboards belonging to the app.

Example

var SunshineConversationsClient = require('sunshine-conversations-client');
var defaultClient = SunshineConversationsClient.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR_USERNAME';
basicAuth.password = 'YOUR_PASSWORD';

// Uncomment this section to use JWTs instead
// var bearerAuth = defaultClient.authentications['bearerAuth'];
// bearerAuth.accessToken = 'YOUR_ACCESS_TOKEN';

var apiInstance = new SunshineConversationsClient.SwitchboardsApi();
var appId = "5d8cff3cd55b040010928b5b"; // String | Identifies the app.
apiInstance.listSwitchboards(appId).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
appId String Identifies the app.

Return type

SwitchboardListResponse

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

updateSwitchboard

SwitchboardResponse updateSwitchboard(appId, switchboardId, switchboardUpdateBody)

Update Switchboard

Updates a switchboard record.

Example

var SunshineConversationsClient = require('sunshine-conversations-client');
var defaultClient = SunshineConversationsClient.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR_USERNAME';
basicAuth.password = 'YOUR_PASSWORD';

// Uncomment this section to use JWTs instead
// var bearerAuth = defaultClient.authentications['bearerAuth'];
// bearerAuth.accessToken = 'YOUR_ACCESS_TOKEN';

var apiInstance = new SunshineConversationsClient.SwitchboardsApi();
var appId = "5d8cff3cd55b040010928b5b"; // String | Identifies the app.
var switchboardId = "5d8cff3cd55b040010928b5b"; // String | Identifies the switchboard.
var switchboardUpdateBody = new SunshineConversationsClient.SwitchboardUpdateBody(); // SwitchboardUpdateBody | 
apiInstance.updateSwitchboard(appId, switchboardId, switchboardUpdateBody).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
appId String Identifies the app.
switchboardId String Identifies the switchboard.
switchboardUpdateBody SwitchboardUpdateBody

Return type

SwitchboardResponse

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json