Skip to content

Latest commit

 

History

History
238 lines (150 loc) · 6.4 KB

File metadata and controls

238 lines (150 loc) · 6.4 KB

SunshineConversationsClient.AppKeysApi

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

Method HTTP request Description
createAppKey POST /v2/apps/{appId}/keys Create App Key
deleteAppKey DELETE /v2/apps/{appId}/keys/{keyId} Delete App Key
getAppKey GET /v2/apps/{appId}/keys/{keyId} Get App Key
listAppKeys GET /v2/apps/{appId}/keys List App Keys

createAppKey

AppKeyResponse createAppKey(appId, appKeyCreateBody)

Create App Key

Creates an API key for the specified app. The response body will include a secret as well as its corresponding id, which you can use to generate JSON Web Tokens to securely make API calls on behalf of 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.AppKeysApi();
var appId = ""5d8cff3cd55b040010928b5b""; // String | Identifies the app.
var appKeyCreateBody = new SunshineConversationsClient.AppKeyCreateBody(); // AppKeyCreateBody | 
apiInstance.createAppKey(appId, appKeyCreateBody).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.
appKeyCreateBody AppKeyCreateBody

Return type

AppKeyResponse

Authorization

basicAuth, bearerAuth

HTTP request headers

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

deleteAppKey

Object deleteAppKey(appId, keyId)

Delete App Key

Removes an API key.

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.AppKeysApi();
var appId = ""5d8cff3cd55b040010928b5b""; // String | Identifies the app.
var keyId = ""int_5d8cff3cd55b040010928b5b""; // String | The id of the key.
apiInstance.deleteAppKey(appId, keyId).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.
keyId String The id of the key.

Return type

Object

Authorization

basicAuth, bearerAuth

HTTP request headers

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

getAppKey

AppKeyResponse getAppKey(appId, keyId)

Get App Key

Returns an API key.

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.AppKeysApi();
var appId = ""5d8cff3cd55b040010928b5b""; // String | Identifies the app.
var keyId = ""int_5d8cff3cd55b040010928b5b""; // String | The id of the key.
apiInstance.getAppKey(appId, keyId).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.
keyId String The id of the key.

Return type

AppKeyResponse

Authorization

basicAuth, bearerAuth

HTTP request headers

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

listAppKeys

AppKeyListResponse listAppKeys(appId)

List App Keys

Lists all API keys for a given 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.AppKeysApi();
var appId = ""5d8cff3cd55b040010928b5b""; // String | Identifies the app.
apiInstance.listAppKeys(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

AppKeyListResponse

Authorization

basicAuth, bearerAuth

HTTP request headers

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