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 |
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.
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);
});| Name | Type | Description | Notes |
|---|---|---|---|
| appId | String | Identifies the app. | |
| appKeyCreateBody | AppKeyCreateBody |
- Content-Type: application/json
- Accept: application/json
Object deleteAppKey(appId, keyId)
Delete App Key
Removes an API key.
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);
});| Name | Type | Description | Notes |
|---|---|---|---|
| appId | String | Identifies the app. | |
| keyId | String | The id of the key. |
Object
- Content-Type: Not defined
- Accept: application/json
AppKeyResponse getAppKey(appId, keyId)
Get App Key
Returns an API key.
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);
});| Name | Type | Description | Notes |
|---|---|---|---|
| appId | String | Identifies the app. | |
| keyId | String | The id of the key. |
- Content-Type: Not defined
- Accept: application/json
AppKeyListResponse listAppKeys(appId)
List App Keys
Lists all API keys for a given app.
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);
});| Name | Type | Description | Notes |
|---|---|---|---|
| appId | String | Identifies the app. |
- Content-Type: Not defined
- Accept: application/json