purecloud-platform-client-v2
Version:
A JavaScript library to interface with the PureCloud Platform API
1,212 lines (1,122 loc) • 146 kB
JavaScript
import ApiClient from '../ApiClient.js';
class KnowledgeApi {
/**
* Knowledge service.
* @module purecloud-platform-client-v2/api/KnowledgeApi
* @version 223.0.0
*/
/**
* Constructs a new KnowledgeApi.
* @alias module:purecloud-platform-client-v2/api/KnowledgeApi
* @class
* @param {module:purecloud-platform-client-v2/ApiClient} apiClient Optional API client implementation to use,
* default to {@link module:purecloud-platform-client-v2/ApiClient#instance} if unspecified.
*/
constructor(apiClient) {
this.apiClient = apiClient || ApiClient.instance;
}
/**
* Delete knowledge base
*
* @param {String} knowledgeBaseId Knowledge base ID
*/
deleteKnowledgeKnowledgebase(knowledgeBaseId) {
// verify the required parameter 'knowledgeBaseId' is set
if (knowledgeBaseId === undefined || knowledgeBaseId === null) {
throw 'Missing the required parameter "knowledgeBaseId" when calling deleteKnowledgeKnowledgebase';
}
return this.apiClient.callApi(
'/api/v2/knowledge/knowledgebases/{knowledgeBaseId}',
'DELETE',
{ 'knowledgeBaseId': knowledgeBaseId },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Delete category
*
* @param {String} knowledgeBaseId Knowledge base ID
* @param {String} categoryId Category ID
*/
deleteKnowledgeKnowledgebaseCategory(knowledgeBaseId, categoryId) {
// verify the required parameter 'knowledgeBaseId' is set
if (knowledgeBaseId === undefined || knowledgeBaseId === null) {
throw 'Missing the required parameter "knowledgeBaseId" when calling deleteKnowledgeKnowledgebaseCategory';
}
// verify the required parameter 'categoryId' is set
if (categoryId === undefined || categoryId === null) {
throw 'Missing the required parameter "categoryId" when calling deleteKnowledgeKnowledgebaseCategory';
}
return this.apiClient.callApi(
'/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/categories/{categoryId}',
'DELETE',
{ 'knowledgeBaseId': knowledgeBaseId,'categoryId': categoryId },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Delete document.
*
* @param {String} knowledgeBaseId Knowledge base ID.
* @param {String} documentId Document ID.
*/
deleteKnowledgeKnowledgebaseDocument(knowledgeBaseId, documentId) {
// verify the required parameter 'knowledgeBaseId' is set
if (knowledgeBaseId === undefined || knowledgeBaseId === null) {
throw 'Missing the required parameter "knowledgeBaseId" when calling deleteKnowledgeKnowledgebaseDocument';
}
// verify the required parameter 'documentId' is set
if (documentId === undefined || documentId === null) {
throw 'Missing the required parameter "documentId" when calling deleteKnowledgeKnowledgebaseDocument';
}
return this.apiClient.callApi(
'/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/documents/{documentId}',
'DELETE',
{ 'knowledgeBaseId': knowledgeBaseId,'documentId': documentId },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Delete a variation for a document.
*
* @param {String} documentVariationId Globally unique identifier for a document variation.
* @param {String} documentId Globally unique identifier for a document.
* @param {String} knowledgeBaseId Globally unique identifier for a knowledge base.
*/
deleteKnowledgeKnowledgebaseDocumentVariation(documentVariationId, documentId, knowledgeBaseId) {
// verify the required parameter 'documentVariationId' is set
if (documentVariationId === undefined || documentVariationId === null) {
throw 'Missing the required parameter "documentVariationId" when calling deleteKnowledgeKnowledgebaseDocumentVariation';
}
// verify the required parameter 'documentId' is set
if (documentId === undefined || documentId === null) {
throw 'Missing the required parameter "documentId" when calling deleteKnowledgeKnowledgebaseDocumentVariation';
}
// verify the required parameter 'knowledgeBaseId' is set
if (knowledgeBaseId === undefined || knowledgeBaseId === null) {
throw 'Missing the required parameter "knowledgeBaseId" when calling deleteKnowledgeKnowledgebaseDocumentVariation';
}
return this.apiClient.callApi(
'/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/documents/{documentId}/variations/{documentVariationId}',
'DELETE',
{ 'documentVariationId': documentVariationId,'documentId': documentId,'knowledgeBaseId': knowledgeBaseId },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Delete export job
*
* @param {String} knowledgeBaseId Knowledge base ID
* @param {String} exportJobId Export job ID
*/
deleteKnowledgeKnowledgebaseExportJob(knowledgeBaseId, exportJobId) {
// verify the required parameter 'knowledgeBaseId' is set
if (knowledgeBaseId === undefined || knowledgeBaseId === null) {
throw 'Missing the required parameter "knowledgeBaseId" when calling deleteKnowledgeKnowledgebaseExportJob';
}
// verify the required parameter 'exportJobId' is set
if (exportJobId === undefined || exportJobId === null) {
throw 'Missing the required parameter "exportJobId" when calling deleteKnowledgeKnowledgebaseExportJob';
}
return this.apiClient.callApi(
'/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/export/jobs/{exportJobId}',
'DELETE',
{ 'knowledgeBaseId': knowledgeBaseId,'exportJobId': exportJobId },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Delete import job
*
* @param {String} knowledgeBaseId Knowledge base ID
* @param {String} importJobId Import job ID
*/
deleteKnowledgeKnowledgebaseImportJob(knowledgeBaseId, importJobId) {
// verify the required parameter 'knowledgeBaseId' is set
if (knowledgeBaseId === undefined || knowledgeBaseId === null) {
throw 'Missing the required parameter "knowledgeBaseId" when calling deleteKnowledgeKnowledgebaseImportJob';
}
// verify the required parameter 'importJobId' is set
if (importJobId === undefined || importJobId === null) {
throw 'Missing the required parameter "importJobId" when calling deleteKnowledgeKnowledgebaseImportJob';
}
return this.apiClient.callApi(
'/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/import/jobs/{importJobId}',
'DELETE',
{ 'knowledgeBaseId': knowledgeBaseId,'importJobId': importJobId },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Delete label
*
* @param {String} knowledgeBaseId Knowledge base ID
* @param {String} labelId Label ID
*/
deleteKnowledgeKnowledgebaseLabel(knowledgeBaseId, labelId) {
// verify the required parameter 'knowledgeBaseId' is set
if (knowledgeBaseId === undefined || knowledgeBaseId === null) {
throw 'Missing the required parameter "knowledgeBaseId" when calling deleteKnowledgeKnowledgebaseLabel';
}
// verify the required parameter 'labelId' is set
if (labelId === undefined || labelId === null) {
throw 'Missing the required parameter "labelId" when calling deleteKnowledgeKnowledgebaseLabel';
}
return this.apiClient.callApi(
'/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/labels/{labelId}',
'DELETE',
{ 'knowledgeBaseId': knowledgeBaseId,'labelId': labelId },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Delete category
*
* @param {String} categoryId Category ID
* @param {String} knowledgeBaseId Knowledge base ID
* @param {Object} languageCode Language code, format: iso2-LOCALE
* @deprecated
*/
deleteKnowledgeKnowledgebaseLanguageCategory(categoryId, knowledgeBaseId, languageCode) {
// verify the required parameter 'categoryId' is set
if (categoryId === undefined || categoryId === null) {
throw 'Missing the required parameter "categoryId" when calling deleteKnowledgeKnowledgebaseLanguageCategory';
}
// verify the required parameter 'knowledgeBaseId' is set
if (knowledgeBaseId === undefined || knowledgeBaseId === null) {
throw 'Missing the required parameter "knowledgeBaseId" when calling deleteKnowledgeKnowledgebaseLanguageCategory';
}
// verify the required parameter 'languageCode' is set
if (languageCode === undefined || languageCode === null) {
throw 'Missing the required parameter "languageCode" when calling deleteKnowledgeKnowledgebaseLanguageCategory';
}
return this.apiClient.callApi(
'/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/languages/{languageCode}/categories/{categoryId}',
'DELETE',
{ 'categoryId': categoryId,'knowledgeBaseId': knowledgeBaseId,'languageCode': languageCode },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Delete document
*
* @param {String} documentId Document ID
* @param {String} knowledgeBaseId Knowledge base ID
* @param {Object} languageCode Language code, format: iso2-LOCALE
* @deprecated
*/
deleteKnowledgeKnowledgebaseLanguageDocument(documentId, knowledgeBaseId, languageCode) {
// verify the required parameter 'documentId' is set
if (documentId === undefined || documentId === null) {
throw 'Missing the required parameter "documentId" when calling deleteKnowledgeKnowledgebaseLanguageDocument';
}
// verify the required parameter 'knowledgeBaseId' is set
if (knowledgeBaseId === undefined || knowledgeBaseId === null) {
throw 'Missing the required parameter "knowledgeBaseId" when calling deleteKnowledgeKnowledgebaseLanguageDocument';
}
// verify the required parameter 'languageCode' is set
if (languageCode === undefined || languageCode === null) {
throw 'Missing the required parameter "languageCode" when calling deleteKnowledgeKnowledgebaseLanguageDocument';
}
return this.apiClient.callApi(
'/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/languages/{languageCode}/documents/{documentId}',
'DELETE',
{ 'documentId': documentId,'knowledgeBaseId': knowledgeBaseId,'languageCode': languageCode },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Delete import operation
*
* @param {String} knowledgeBaseId Knowledge base ID
* @param {Object} languageCode Language code, format: iso2-LOCALE
* @param {String} importId Import ID
* @deprecated
*/
deleteKnowledgeKnowledgebaseLanguageDocumentsImport(knowledgeBaseId, languageCode, importId) {
// verify the required parameter 'knowledgeBaseId' is set
if (knowledgeBaseId === undefined || knowledgeBaseId === null) {
throw 'Missing the required parameter "knowledgeBaseId" when calling deleteKnowledgeKnowledgebaseLanguageDocumentsImport';
}
// verify the required parameter 'languageCode' is set
if (languageCode === undefined || languageCode === null) {
throw 'Missing the required parameter "languageCode" when calling deleteKnowledgeKnowledgebaseLanguageDocumentsImport';
}
// verify the required parameter 'importId' is set
if (importId === undefined || importId === null) {
throw 'Missing the required parameter "importId" when calling deleteKnowledgeKnowledgebaseLanguageDocumentsImport';
}
return this.apiClient.callApi(
'/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/languages/{languageCode}/documents/imports/{importId}',
'DELETE',
{ 'knowledgeBaseId': knowledgeBaseId,'languageCode': languageCode,'importId': importId },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Delete Salesforce Knowledge integration source
*
* @param {String} knowledgeBaseId Knowledge base ID
* @param {String} sourceId Source ID
*/
deleteKnowledgeKnowledgebaseSourcesSalesforceSourceId(knowledgeBaseId, sourceId) {
// verify the required parameter 'knowledgeBaseId' is set
if (knowledgeBaseId === undefined || knowledgeBaseId === null) {
throw 'Missing the required parameter "knowledgeBaseId" when calling deleteKnowledgeKnowledgebaseSourcesSalesforceSourceId';
}
// verify the required parameter 'sourceId' is set
if (sourceId === undefined || sourceId === null) {
throw 'Missing the required parameter "sourceId" when calling deleteKnowledgeKnowledgebaseSourcesSalesforceSourceId';
}
return this.apiClient.callApi(
'/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/sources/salesforce/{sourceId}',
'DELETE',
{ 'knowledgeBaseId': knowledgeBaseId,'sourceId': sourceId },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Delete ServiceNow Knowledge integration source
*
* @param {String} knowledgeBaseId Knowledge base ID
* @param {String} sourceId Source ID
*/
deleteKnowledgeKnowledgebaseSourcesServicenowSourceId(knowledgeBaseId, sourceId) {
// verify the required parameter 'knowledgeBaseId' is set
if (knowledgeBaseId === undefined || knowledgeBaseId === null) {
throw 'Missing the required parameter "knowledgeBaseId" when calling deleteKnowledgeKnowledgebaseSourcesServicenowSourceId';
}
// verify the required parameter 'sourceId' is set
if (sourceId === undefined || sourceId === null) {
throw 'Missing the required parameter "sourceId" when calling deleteKnowledgeKnowledgebaseSourcesServicenowSourceId';
}
return this.apiClient.callApi(
'/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/sources/servicenow/{sourceId}',
'DELETE',
{ 'knowledgeBaseId': knowledgeBaseId,'sourceId': sourceId },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Delete synchronization job
*
* @param {String} knowledgeBaseId Knowledge base ID
* @param {String} syncJobId Synchronization job ID
*/
deleteKnowledgeKnowledgebaseSynchronizeJob(knowledgeBaseId, syncJobId) {
// verify the required parameter 'knowledgeBaseId' is set
if (knowledgeBaseId === undefined || knowledgeBaseId === null) {
throw 'Missing the required parameter "knowledgeBaseId" when calling deleteKnowledgeKnowledgebaseSynchronizeJob';
}
// verify the required parameter 'syncJobId' is set
if (syncJobId === undefined || syncJobId === null) {
throw 'Missing the required parameter "syncJobId" when calling deleteKnowledgeKnowledgebaseSynchronizeJob';
}
return this.apiClient.callApi(
'/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/synchronize/jobs/{syncJobId}',
'DELETE',
{ 'knowledgeBaseId': knowledgeBaseId,'syncJobId': syncJobId },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get categories
*
* @param {String} sessionId Knowledge guest session ID.
* @param {Object} opts Optional parameters
* @param {String} opts.before The cursor that points to the start of the set of entities that has been returned.
* @param {String} opts.after The cursor that points to the end of the set of entities that has been returned.
* @param {String} opts.pageSize Number of entities to return. Maximum of 200.
* @param {String} opts.parentId If specified, retrieves the children categories by parent category ID.
* @param {Boolean} opts.isRoot If specified, retrieves only the root categories.
* @param {String} opts.name Filter to return the categories that starts with the given category name.
* @param {Object} opts.sortBy Name: sort by category names alphabetically; Hierarchy: sort by the full path of hierarchical category names alphabetically (default to Name)
* @param {String} opts.expand The specified entity attribute will be filled. Supported value:Ancestors: every ancestors will be filled via the parent attribute recursively,but only the id, name, parentId will be present for the ancestors.
* @param {Boolean} opts.includeDocumentCount If specified, retrieves the number of documents related to category.
*/
getKnowledgeGuestSessionCategories(sessionId, opts) {
opts = opts || {};
// verify the required parameter 'sessionId' is set
if (sessionId === undefined || sessionId === null) {
throw 'Missing the required parameter "sessionId" when calling getKnowledgeGuestSessionCategories';
}
return this.apiClient.callApi(
'/api/v2/knowledge/guest/sessions/{sessionId}/categories',
'GET',
{ 'sessionId': sessionId },
{ 'before': opts['before'],'after': opts['after'],'pageSize': opts['pageSize'],'parentId': opts['parentId'],'isRoot': opts['isRoot'],'name': opts['name'],'sortBy': opts['sortBy'],'expand': opts['expand'],'includeDocumentCount': opts['includeDocumentCount'] },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get a knowledge document by ID.
*
* @param {String} sessionId Knowledge guest session ID.
* @param {String} documentId Document ID
*/
getKnowledgeGuestSessionDocument(sessionId, documentId) {
// verify the required parameter 'sessionId' is set
if (sessionId === undefined || sessionId === null) {
throw 'Missing the required parameter "sessionId" when calling getKnowledgeGuestSessionDocument';
}
// verify the required parameter 'documentId' is set
if (documentId === undefined || documentId === null) {
throw 'Missing the required parameter "documentId" when calling getKnowledgeGuestSessionDocument';
}
return this.apiClient.callApi(
'/api/v2/knowledge/guest/sessions/{sessionId}/documents/{documentId}',
'GET',
{ 'sessionId': sessionId,'documentId': documentId },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get documents.
*
* @param {String} sessionId Knowledge guest session ID.
* @param {Object} opts Optional parameters
* @param {Array.<String>} opts.categoryId If specified, retrieves documents associated with category ids, comma separated values expected.
* @param {Number} opts.pageSize Number of entities to return. Maximum of 200.
*/
getKnowledgeGuestSessionDocuments(sessionId, opts) {
opts = opts || {};
// verify the required parameter 'sessionId' is set
if (sessionId === undefined || sessionId === null) {
throw 'Missing the required parameter "sessionId" when calling getKnowledgeGuestSessionDocuments';
}
return this.apiClient.callApi(
'/api/v2/knowledge/guest/sessions/{sessionId}/documents',
'GET',
{ 'sessionId': sessionId },
{ 'categoryId': this.apiClient.buildCollectionParam(opts['categoryId'], 'multi'),'pageSize': opts['pageSize'] },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get sync options available for a knowledge-connect integration
*
* @param {String} integrationId Integration ID
* @param {Object} opts Optional parameters
* @param {Array.<String>} opts.knowledgeBaseIds Narrowing down filtering option results by knowledge base.
*/
getKnowledgeIntegrationOptions(integrationId, opts) {
opts = opts || {};
// verify the required parameter 'integrationId' is set
if (integrationId === undefined || integrationId === null) {
throw 'Missing the required parameter "integrationId" when calling getKnowledgeIntegrationOptions';
}
return this.apiClient.callApi(
'/api/v2/knowledge/integrations/{integrationId}/options',
'GET',
{ 'integrationId': integrationId },
{ 'knowledgeBaseIds': this.apiClient.buildCollectionParam(opts['knowledgeBaseIds'], 'multi') },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get knowledge base
*
* @param {String} knowledgeBaseId Knowledge base ID
*/
getKnowledgeKnowledgebase(knowledgeBaseId) {
// verify the required parameter 'knowledgeBaseId' is set
if (knowledgeBaseId === undefined || knowledgeBaseId === null) {
throw 'Missing the required parameter "knowledgeBaseId" when calling getKnowledgeKnowledgebase';
}
return this.apiClient.callApi(
'/api/v2/knowledge/knowledgebases/{knowledgeBaseId}',
'GET',
{ 'knowledgeBaseId': knowledgeBaseId },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get categories
*
* @param {String} knowledgeBaseId Knowledge base ID
* @param {Object} opts Optional parameters
* @param {String} opts.before The cursor that points to the start of the set of entities that has been returned.
* @param {String} opts.after The cursor that points to the end of the set of entities that has been returned.
* @param {String} opts.pageSize Number of entities to return. Maximum of 200.
* @param {String} opts.parentId If specified, retrieves the children categories by parent category ID.
* @param {Boolean} opts.isRoot If specified, retrieves only the root categories.
* @param {String} opts.name Filter to return the categories that starts with the given category name.
* @param {Object} opts.sortBy Name: sort by category names alphabetically; Hierarchy: sort by the full path of hierarchical category names alphabetically (default to Name)
* @param {String} opts.expand The specified entity attribute will be filled. Supported value:Ancestors: every ancestors will be filled via the parent attribute recursively,but only the id, name, parentId will be present for the ancestors.
* @param {Boolean} opts.includeDocumentCount If specified, retrieves the number of documents related to category.
*/
getKnowledgeKnowledgebaseCategories(knowledgeBaseId, opts) {
opts = opts || {};
// verify the required parameter 'knowledgeBaseId' is set
if (knowledgeBaseId === undefined || knowledgeBaseId === null) {
throw 'Missing the required parameter "knowledgeBaseId" when calling getKnowledgeKnowledgebaseCategories';
}
return this.apiClient.callApi(
'/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/categories',
'GET',
{ 'knowledgeBaseId': knowledgeBaseId },
{ 'before': opts['before'],'after': opts['after'],'pageSize': opts['pageSize'],'parentId': opts['parentId'],'isRoot': opts['isRoot'],'name': opts['name'],'sortBy': opts['sortBy'],'expand': opts['expand'],'includeDocumentCount': opts['includeDocumentCount'] },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get category
*
* @param {String} knowledgeBaseId Knowledge base ID
* @param {String} categoryId Category ID
*/
getKnowledgeKnowledgebaseCategory(knowledgeBaseId, categoryId) {
// verify the required parameter 'knowledgeBaseId' is set
if (knowledgeBaseId === undefined || knowledgeBaseId === null) {
throw 'Missing the required parameter "knowledgeBaseId" when calling getKnowledgeKnowledgebaseCategory';
}
// verify the required parameter 'categoryId' is set
if (categoryId === undefined || categoryId === null) {
throw 'Missing the required parameter "categoryId" when calling getKnowledgeKnowledgebaseCategory';
}
return this.apiClient.callApi(
'/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/categories/{categoryId}',
'GET',
{ 'knowledgeBaseId': knowledgeBaseId,'categoryId': categoryId },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get document.
*
* @param {String} knowledgeBaseId Knowledge base ID.
* @param {String} documentId Document ID.
* @param {Object} opts Optional parameters
* @param {Array.<String>} opts.expand The specified entity attributes will be filled. Comma separated values expected. Max No. of variations that can be returned on expand is 20.
* @param {Object} opts.state when state is Draft, draft version of the document is returned,otherwise by default published version is returned in the response.
*/
getKnowledgeKnowledgebaseDocument(knowledgeBaseId, documentId, opts) {
opts = opts || {};
// verify the required parameter 'knowledgeBaseId' is set
if (knowledgeBaseId === undefined || knowledgeBaseId === null) {
throw 'Missing the required parameter "knowledgeBaseId" when calling getKnowledgeKnowledgebaseDocument';
}
// verify the required parameter 'documentId' is set
if (documentId === undefined || documentId === null) {
throw 'Missing the required parameter "documentId" when calling getKnowledgeKnowledgebaseDocument';
}
return this.apiClient.callApi(
'/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/documents/{documentId}',
'GET',
{ 'knowledgeBaseId': knowledgeBaseId,'documentId': documentId },
{ 'expand': this.apiClient.buildCollectionParam(opts['expand'], 'multi'),'state': opts['state'] },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get a list of feedback records given on a document
*
* @param {String} knowledgeBaseId Knowledge base ID.
* @param {String} documentId Document ID.
* @param {Object} opts Optional parameters
* @param {String} opts.before The cursor that points to the start of the set of entities that has been returned.
* @param {String} opts.after The cursor that points to the end of the set of entities that has been returned.
* @param {String} opts.pageSize Number of entities to return. Maximum of 200.
* @param {Boolean} opts.onlyCommented If true, only feedback records that have comment are returned. If false, feedback records with and without comment are returned. Default: false.
* @param {String} opts.documentVersionId Document version ID to filter by. Supported only if onlyCommented=true is set.
* @param {String} opts.documentVariationId Document variation ID to filter by. Supported only if onlyCommented=true is set.
* @param {Object} opts.appType Application type to filter by. Supported only if onlyCommented=true is set.
* @param {Object} opts.queryType Query type to filter by. Supported only if onlyCommented=true is set.
* @param {String} opts.userId The ID of the user, who created the feedback, to filter by. Supported only if onlyCommented=true is set.
* @param {String} opts.queueId Queue ID to filter by. Supported only if onlyCommented=true is set.
* @param {Object} opts.state State to filter by. Supported only if onlyCommented=true is set. Default: Final
*/
getKnowledgeKnowledgebaseDocumentFeedback(knowledgeBaseId, documentId, opts) {
opts = opts || {};
// verify the required parameter 'knowledgeBaseId' is set
if (knowledgeBaseId === undefined || knowledgeBaseId === null) {
throw 'Missing the required parameter "knowledgeBaseId" when calling getKnowledgeKnowledgebaseDocumentFeedback';
}
// verify the required parameter 'documentId' is set
if (documentId === undefined || documentId === null) {
throw 'Missing the required parameter "documentId" when calling getKnowledgeKnowledgebaseDocumentFeedback';
}
return this.apiClient.callApi(
'/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/documents/{documentId}/feedback',
'GET',
{ 'knowledgeBaseId': knowledgeBaseId,'documentId': documentId },
{ 'before': opts['before'],'after': opts['after'],'pageSize': opts['pageSize'],'onlyCommented': opts['onlyCommented'],'documentVersionId': opts['documentVersionId'],'documentVariationId': opts['documentVariationId'],'appType': opts['appType'],'queryType': opts['queryType'],'userId': opts['userId'],'queueId': opts['queueId'],'state': opts['state'] },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get a single feedback record given on a document
*
* @param {String} knowledgeBaseId Knowledge base ID.
* @param {String} documentId Document ID.
* @param {String} feedbackId Feedback ID.
*/
getKnowledgeKnowledgebaseDocumentFeedbackFeedbackId(knowledgeBaseId, documentId, feedbackId) {
// verify the required parameter 'knowledgeBaseId' is set
if (knowledgeBaseId === undefined || knowledgeBaseId === null) {
throw 'Missing the required parameter "knowledgeBaseId" when calling getKnowledgeKnowledgebaseDocumentFeedbackFeedbackId';
}
// verify the required parameter 'documentId' is set
if (documentId === undefined || documentId === null) {
throw 'Missing the required parameter "documentId" when calling getKnowledgeKnowledgebaseDocumentFeedbackFeedbackId';
}
// verify the required parameter 'feedbackId' is set
if (feedbackId === undefined || feedbackId === null) {
throw 'Missing the required parameter "feedbackId" when calling getKnowledgeKnowledgebaseDocumentFeedbackFeedbackId';
}
return this.apiClient.callApi(
'/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/documents/{documentId}/feedback/{feedbackId}',
'GET',
{ 'knowledgeBaseId': knowledgeBaseId,'documentId': documentId,'feedbackId': feedbackId },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get a variation for a document.
*
* @param {String} documentVariationId Globally unique identifier for a document variation.
* @param {String} documentId Globally unique identifier for a document.
* @param {String} knowledgeBaseId Globally unique identifier for a knowledge base.
* @param {Object} opts Optional parameters
* @param {Object} opts.documentState The state of the document.
* @param {Array.<String>} opts.expand The specified entity attributes will be filled. Comma separated values expected.
*/
getKnowledgeKnowledgebaseDocumentVariation(documentVariationId, documentId, knowledgeBaseId, opts) {
opts = opts || {};
// verify the required parameter 'documentVariationId' is set
if (documentVariationId === undefined || documentVariationId === null) {
throw 'Missing the required parameter "documentVariationId" when calling getKnowledgeKnowledgebaseDocumentVariation';
}
// verify the required parameter 'documentId' is set
if (documentId === undefined || documentId === null) {
throw 'Missing the required parameter "documentId" when calling getKnowledgeKnowledgebaseDocumentVariation';
}
// verify the required parameter 'knowledgeBaseId' is set
if (knowledgeBaseId === undefined || knowledgeBaseId === null) {
throw 'Missing the required parameter "knowledgeBaseId" when calling getKnowledgeKnowledgebaseDocumentVariation';
}
return this.apiClient.callApi(
'/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/documents/{documentId}/variations/{documentVariationId}',
'GET',
{ 'documentVariationId': documentVariationId,'documentId': documentId,'knowledgeBaseId': knowledgeBaseId },
{ 'documentState': opts['documentState'],'expand': this.apiClient.buildCollectionParam(opts['expand'], 'multi') },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get variations for a document.
*
* @param {String} knowledgeBaseId Globally unique identifier for the knowledge base.
* @param {String} documentId Globally unique identifier for the document.
* @param {Object} opts Optional parameters
* @param {String} opts.before The cursor that points to the start of the set of entities that has been returned.
* @param {String} opts.after The cursor that points to the end of the set of entities that has been returned.
* @param {String} opts.pageSize Number of entities to return. Maximum of 200.
* @param {Object} opts.documentState The state of the document.
* @param {Array.<String>} opts.expand The specified entity attributes will be filled. Comma separated values expected.
*/
getKnowledgeKnowledgebaseDocumentVariations(knowledgeBaseId, documentId, opts) {
opts = opts || {};
// verify the required parameter 'knowledgeBaseId' is set
if (knowledgeBaseId === undefined || knowledgeBaseId === null) {
throw 'Missing the required parameter "knowledgeBaseId" when calling getKnowledgeKnowledgebaseDocumentVariations';
}
// verify the required parameter 'documentId' is set
if (documentId === undefined || documentId === null) {
throw 'Missing the required parameter "documentId" when calling getKnowledgeKnowledgebaseDocumentVariations';
}
return this.apiClient.callApi(
'/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/documents/{documentId}/variations',
'GET',
{ 'knowledgeBaseId': knowledgeBaseId,'documentId': documentId },
{ 'before': opts['before'],'after': opts['after'],'pageSize': opts['pageSize'],'documentState': opts['documentState'],'expand': this.apiClient.buildCollectionParam(opts['expand'], 'multi') },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get document version.
*
* @param {String} knowledgeBaseId Globally unique identifier for the knowledge base.
* @param {String} documentId Globally unique identifier for the document.
* @param {String} versionId Globally unique identifier for the document version.
* @param {Object} opts Optional parameters
* @param {Array.<String>} opts.expand The specified entity attributes will be filled. Comma separated values expected.
*/
getKnowledgeKnowledgebaseDocumentVersion(knowledgeBaseId, documentId, versionId, opts) {
opts = opts || {};
// verify the required parameter 'knowledgeBaseId' is set
if (knowledgeBaseId === undefined || knowledgeBaseId === null) {
throw 'Missing the required parameter "knowledgeBaseId" when calling getKnowledgeKnowledgebaseDocumentVersion';
}
// verify the required parameter 'documentId' is set
if (documentId === undefined || documentId === null) {
throw 'Missing the required parameter "documentId" when calling getKnowledgeKnowledgebaseDocumentVersion';
}
// verify the required parameter 'versionId' is set
if (versionId === undefined || versionId === null) {
throw 'Missing the required parameter "versionId" when calling getKnowledgeKnowledgebaseDocumentVersion';
}
return this.apiClient.callApi(
'/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/documents/{documentId}/versions/{versionId}',
'GET',
{ 'knowledgeBaseId': knowledgeBaseId,'documentId': documentId,'versionId': versionId },
{ 'expand': this.apiClient.buildCollectionParam(opts['expand'], 'multi') },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get variation for the given document version.
*
* @param {String} knowledgeBaseId Globally unique identifier for the knowledge base.
* @param {String} documentId Globally unique identifier for the document.
* @param {String} versionId Globally unique identifier for the document version.
* @param {String} variationId Globally unique identifier for the document version variation.
*/
getKnowledgeKnowledgebaseDocumentVersionVariation(knowledgeBaseId, documentId, versionId, variationId) {
// verify the required parameter 'knowledgeBaseId' is set
if (knowledgeBaseId === undefined || knowledgeBaseId === null) {
throw 'Missing the required parameter "knowledgeBaseId" when calling getKnowledgeKnowledgebaseDocumentVersionVariation';
}
// verify the required parameter 'documentId' is set
if (documentId === undefined || documentId === null) {
throw 'Missing the required parameter "documentId" when calling getKnowledgeKnowledgebaseDocumentVersionVariation';
}
// verify the required parameter 'versionId' is set
if (versionId === undefined || versionId === null) {
throw 'Missing the required parameter "versionId" when calling getKnowledgeKnowledgebaseDocumentVersionVariation';
}
// verify the required parameter 'variationId' is set
if (variationId === undefined || variationId === null) {
throw 'Missing the required parameter "variationId" when calling getKnowledgeKnowledgebaseDocumentVersionVariation';
}
return this.apiClient.callApi(
'/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/documents/{documentId}/versions/{versionId}/variations/{variationId}',
'GET',
{ 'knowledgeBaseId': knowledgeBaseId,'documentId': documentId,'versionId': versionId,'variationId': variationId },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get variations for the given document version.
*
* @param {String} knowledgeBaseId Globally unique identifier for the knowledge base.
* @param {String} documentId Globally unique identifier for the document.
* @param {String} versionId Globally unique identifier for the document version.
* @param {Object} opts Optional parameters
* @param {String} opts.before The cursor that points to the start of the set of entities that has been returned.
* @param {String} opts.after The cursor that points to the end of the set of entities that has been returned.
* @param {String} opts.pageSize Number of entities to return. Maximum of 200.
*/
getKnowledgeKnowledgebaseDocumentVersionVariations(knowledgeBaseId, documentId, versionId, opts) {
opts = opts || {};
// verify the required parameter 'knowledgeBaseId' is set
if (knowledgeBaseId === undefined || knowledgeBaseId === null) {
throw 'Missing the required parameter "knowledgeBaseId" when calling getKnowledgeKnowledgebaseDocumentVersionVariations';
}
// verify the required parameter 'documentId' is set
if (documentId === undefined || documentId === null) {
throw 'Missing the required parameter "documentId" when calling getKnowledgeKnowledgebaseDocumentVersionVariations';
}
// verify the required parameter 'versionId' is set
if (versionId === undefined || versionId === null) {
throw 'Missing the required parameter "versionId" when calling getKnowledgeKnowledgebaseDocumentVersionVariations';
}
return this.apiClient.callApi(
'/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/documents/{documentId}/versions/{versionId}/variations',
'GET',
{ 'knowledgeBaseId': knowledgeBaseId,'documentId': documentId,'versionId': versionId },
{ 'before': opts['before'],'after': opts['after'],'pageSize': opts['pageSize'] },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get document versions.
*
* @param {String} knowledgeBaseId Globally unique identifier for the knowledge base.
* @param {String} documentId Globally unique identifier for the document.
* @param {Object} opts Optional parameters
* @param {String} opts.before The cursor that points to the start of the set of entities that has been returned.
* @param {String} opts.after The cursor that points to the end of the set of entities that has been returned.
* @param {String} opts.pageSize Number of entities to return. Maximum of 200.
* @param {Array.<String>} opts.expand The specified entity attributes will be filled. Comma separated values expected.
*/
getKnowledgeKnowledgebaseDocumentVersions(knowledgeBaseId, documentId, opts) {
opts = opts || {};
// verify the required parameter 'knowledgeBaseId' is set
if (knowledgeBaseId === undefined || knowledgeBaseId === null) {
throw 'Missing the required parameter "knowledgeBaseId" when calling getKnowledgeKnowledgebaseDocumentVersions';
}
// verify the required parameter 'documentId' is set
if (documentId === undefined || documentId === null) {
throw 'Missing the required parameter "documentId" when calling getKnowledgeKnowledgebaseDocumentVersions';
}
return this.apiClient.callApi(
'/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/documents/{documentId}/versions',
'GET',
{ 'knowledgeBaseId': knowledgeBaseId,'documentId': documentId },
{ 'before': opts['before'],'after': opts['after'],'pageSize': opts['pageSize'],'expand': this.apiClient.buildCollectionParam(opts['expand'], 'multi') },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get documents.
*
* @param {String} knowledgeBaseId Knowledge base ID
* @param {Object} opts Optional parameters
* @param {String} opts.before The cursor that points to the start of the set of entities that has been returned.
* @param {String} opts.after The cursor that points to the end of the set of entities that has been returned.
* @param {String} opts.pageSize Number of entities to return. Maximum of 200.
* @param {String} opts.interval Retrieves the documents modified in specified date and time range. If the after and before cursor parameters are within this interval, it would return valid data, otherwise it throws an error.The dates in the interval are represented in ISO-8601 format: YYYY-MM-DDThh:mm:ssZ/YYYY-MM-DDThh:mm:ssZ
* @param {Array.<String>} opts.documentId Retrieves the specified documents, comma separated values expected.
* @param {Array.<String>} opts.categoryId If specified, retrieves documents associated with category ids, comma separated values expected.
* @param {Boolean} opts.includeSubcategories Works along with 'categoryId' query parameter. If specified, retrieves documents associated with category ids and its children categories.
* @param {Boolean} opts.includeDrafts If includeDrafts is true, Documents in the draft state are also returned in the response.
* @param {Array.<String>} opts.labelIds If specified, retrieves documents associated with label ids, comma separated values expected.
* @param {Array.<String>} opts.expand The specified entity attributes will be filled. Comma separated values expected.
* @param {Array.<String>} opts.externalIds If specified, retrieves documents associated with external ids, comma separated values expected.
*/
getKnowledgeKnowledgebaseDocuments(knowledgeBaseId, opts) {
opts = opts || {};
// verify the required parameter 'knowledgeBaseId' is set
if (knowledgeBaseId === undefined || knowledgeBaseId === null) {
throw 'Missing the required parameter "knowledgeBaseId" when calling getKnowledgeKnowledgebaseDocuments';
}
return this.apiClient.callApi(
'/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/documents',
'GET',
{ 'knowledgeBaseId': knowledgeBaseId },
{ 'before': opts['before'],'after': opts['after'],'pageSize': opts['pageSize'],'interval': opts['interval'],'documentId': this.apiClient.buildCollectionParam(opts['documentId'], 'multi'),'categoryId': this.apiClient.buildCollectionParam(opts['categoryId'], 'multi'),'includeSubcategories': opts['includeSubcategories'],'includeDrafts': opts['includeDrafts'],'labelIds': this.apiClient.buildCollectionParam(opts['labelIds'], 'multi'),'expand': this.apiClient.buildCollectionParam(opts['expand'], 'multi'),'externalIds': this.apiClient.buildCollectionParam(opts['externalIds'], 'multi') },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get export job report
*
* @param {String} knowledgeBaseId Knowledge base ID
* @param {String} exportJobId Export job ID
*/
getKnowledgeKnowledgebaseExportJob(knowledgeBaseId, exportJobId) {
// verify the required parameter 'knowledgeBaseId' is set
if (knowledgeBaseId === undefined || knowledgeBaseId === null) {
throw 'Missing the required parameter "knowledgeBaseId" when calling getKnowledgeKnowledgebaseExportJob';
}
// verify the required parameter 'exportJobId' is set
if (exportJobId === undefined || exportJobId === null) {
throw 'Missing the required parameter "exportJobId" when calling getKnowledgeKnowledgebaseExportJob';
}
return this.apiClient.callApi(
'/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/export/jobs/{exportJobId}',
'GET',
{ 'knowledgeBaseId': knowledgeBaseId,'exportJobId': exportJobId },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get import job report
*
* @param {String} knowledgeBaseId Knowledge base ID
* @param {String} importJobId Import job ID
* @param {Object} opts Optional parameters
* @param {Array.<String>} opts.expand If expand contains 'urls' downloadURL and failedEntitiesURL will be filled.
*/
getKnowledgeKnowledgebaseImportJob(knowledgeBaseId, importJobId, opts) {
opts = opts || {};
// verify the required parameter 'knowledgeBaseId' is set
if (knowledgeBaseId === undefined || knowledgeBaseId === null) {
throw 'Missing the required parameter "knowledgeBaseId" when calling getKnowledgeKnowledgebaseImportJob';
}
// verify the required parameter 'importJobId' is set
if (importJobId === undefined || importJobId === null) {
throw 'Missing the required parameter "importJobId" when calling getKnowledgeKnowledgebaseImportJob';
}
return this.apiClient.callApi(
'/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/import/jobs/{importJobId}',
'GET',
{ 'knowledgeBaseId': knowledgeBaseId,'importJobId': importJobId },
{ 'expand': this.apiClient.buildCollectionParam(opts['expand'], 'multi') },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get label
*
* @param {String} knowledgeBaseId Knowledge base ID
* @param {String} labelId Label ID
*/
getKnowledgeKnowledgebaseLabel(knowledgeBaseId, labelId) {
// verify the required parameter 'knowledgeBaseId' is set
if (knowledgeBaseId === undefined || knowledgeBaseId === null) {
throw 'Missing the required parameter "knowledgeBaseId" when calling getKnowledgeKnowledgebaseLabel';
}
// verify the required parameter 'labelId' is set
if (labelId === undefined || labelId === null) {
throw 'Missing the required parameter "labelId" when calling getKnowledgeKnowledgebaseLabel';
}
return this.apiClient.callApi(
'/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/labels/{labelId}',
'GET',
{ 'knowledgeBaseId': knowledgeBaseId,'labelId': labelId },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get labels
*
* @param {String} knowledgeBaseId Knowledge base ID
* @param {Object} opts Optional parameters
* @param {String} opts.before The cursor that points to the start of the set of entities that has been returned.
* @param {String} opts.after The cursor that points to the end of the set of entities that has been returned.
* @param {String} opts.pageSize Number of entities to return. Maximum of 200.
* @param {String} opts.name Filter to return the labels that contains the given phrase in the name.
* @param {Boolean} opts.includeDocumentCount If specified, retrieves the number of documents related to label.
*/
getKnowledgeKnowledgebaseLabels(knowledgeBaseId, opts) {
opts = opts || {};
// verify the required parameter 'knowledgeBaseId' is set
if (knowledgeBaseId === undefined || knowledgeBaseId === null) {
throw 'Missing the required parameter "knowledgeBaseId" when calling getKnowledgeKnowledgebaseLabels';
}
return this.apiClient.callApi(
'/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/labels',
'GET',
{ 'knowledgeBaseId': knowledgeBaseId },
{ 'before': opts['before'],'after': opts['after'],'pageSize': opts['pageSize'],'name': opts['name'],'includeDocumentCount': opts['includeDocumentCount'] },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get categories
*
* @param {String} knowledgeBaseId Knowledge base ID
* @param {Object} languageCode Language code, format: iso2-LOCALE
* @param {Object} opts Optional parameters
* @param {String} opts.before The cursor that points to the start of the set of entities that has been returned.
* @param {String} opts.after The cursor that points to the end of the set of entities that has been returned.
* @param {String} opts.limit Number of entities to return. Maximum of 200. Deprecated in favour of pageSize
* @param {String} opts.pageSize Number of entities to return. Maximum of 200.
* @param {String} opts.name Filter to return the categories that starts with the given category name.
* @deprecated
*/
getKnowledgeKnowledgebaseLanguageCategories(knowledgeBaseId, languageCode, opts) {
opts = opts || {};
// verify the required parameter 'knowledgeBaseId' is set
if (knowledgeBaseId === undefined || knowledgeBaseId === null) {
throw 'Missing the required parameter "knowledgeBaseId" when calling getKnowledgeKnowledgebaseLanguageCategories';
}
// verify the required parameter 'languageCode' is set
if (languageCode === undefined || languageCode === null) {
throw 'Missing the required parameter "languageCode" when calling getKnowledgeKnowledgebaseLanguageCategories';
}
return this.apiClient.callApi(
'/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/languages/{languageCode}/categories',
'GET',
{ 'knowledgeBaseId': knowledgeBaseId,'languageCode': languageCode },
{ 'before': opts['before'],'after': opts['after'],'limit': opts['limit'],'pageSize': opts['pageSize'],'name': opts['name'] },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
}
/**
* Get category
*
* @param {String} categoryId Category ID
* @param {String} knowledgeBaseId Knowledge base ID
* @param {Object} languageCode Language code, format: iso2-LOCALE
* @deprecated
*/
getKnowledgeKnowledgebaseLanguageCategory(categoryId, knowledgeBaseId, languageCode) {
// verify the required pa