Voicebase /v2-beta REST API
Browser and node module for making API requests against Voicebase /v2-beta REST API.
Please note: This module uses Popsicle to make API requests. Promises must be supported or polyfilled on all target environments.
Installation
npm install voicebase-v-2-beta-rest-api --save
bower install voicebase-v-2-beta-rest-api --save
Usage
Node
var VoicebaseV2BetaRestApi = ; var client = ;
Browsers
Options
You can set options when you initialize a client or at any time with the options
property. You may also override options for a single request by passing an object as the second argument of any request method. For example:
var client = ... ; clientoptions = ... ; client;
Base URI
You can override the base URI by setting the baseUri
property, or initializing a client with a base URI. For example:
baseUri: 'https://example.com';
Base URI Parameters
If the base URI has parameters inline, you can set them by updating the baseUriParameters
property. For example:
clientoptionsbaseUriParametersversion = 'v2-beta';
Resources
All methods return a HTTP request instance of Popsicle, which allows the use of promises (and streaming in node).
resources.media
Collection of all media and associated analytical results.
var resource = clientresourcesmedia;
GET
Retrieve from the media colection.
resource;
Query Parameters
resource;
- externalId string
A unique identifier in an external system, set in metadata on POST.
POST
Upload new new media to the service as an attachment or from a url.
resource;
Body
multipart/form-data
"media": "description": "Media file attached to the request." "type": "file" "required": true "repeat": false "displayName": "media" "description": "URL where media file can be downloaded." "type": "string" "required": true "repeat": false "displayName": "media" "configuration": "description": "A JSON object with configuration options.\n" "type": "file" "required": false "repeat": false "example": "{\n \"configuration\" : { \n \"template\" : {\n \"name\" : \"default\"\n },\n \"transcripts\" : {\n \"vocabularies\" : [\n\n {\n \"name\": \"earningsCalls\"\n },\n {\n \"terms\" : [\n \"Bob Okunski\",\n \"Chuck Boynton\",\n \"Tom Werner\"\n ]\n }\n\n ]\n },\n \"keywords\" : {\n \"groups\" : [ \"mobile-phone\" ]\n },\n \"predictions\" : {\n \"models\" : {\n \"sales-lead\" : {\n \"output\" : \"extended.sales-followup\"\n },\n \"not-a-sales-lead\" : {\n \"output\" : \"extended.sales-ignore\"\n }\n }\n },\n \"publish\" : {\n \"callbacks\" : [\n \"https://api.example.org/callbacks/{mediaId}\"\n ]\n }\n }\n}\n" "displayName": "configuration" "metadata": "description": "Metadata about the file being posted." "type": "file" "required": false "repeat": false "example": "{\n \"metadata\": {\n \"external\" : {\n \"id\" : \"abc12312321412342315324563443\"\n },\n \"extended\" : {\n \"customer\" : \"John Doe\",\n \"channel\" : \"1 (800) EXAMPLE\",\n \"IVR\" : [ \"existing customer\", \"account services\", \"change my address\" ]\n }\n }\n}\n" "displayName": "metadata" "transcript": "description": "attached transcript" "type": "file" "required": false "repeat": false "displayName": "transcript"
resources.media.mediaId(mediaId)
- mediaId string
Media item and associated analytical results.
var resource = clientresourcesmedia;
GET
Get this media item and associated analytics.
resource;
DELETE
Delete this media.
resource;
POST
Upload new configuration, metadata and/or transcript for re-processing of a media document.
resource;
Body
multipart/form-data
"configuration": "description": "A JSON object with configuration options.\n" "type": "file" "required": false "repeat": false "example": "{\n \"configuration\" : { \n \"template\" : {\n \"name\" : \"default\"\n },\n \"transcripts\" : {\n \"vocabularies\" : [\n\n {\n \"name\": \"earningsCalls\"\n },\n {\n \"terms\" : [\n \"Bob Okunski\",\n \"Chuck Boynton\",\n \"Tom Werner\"\n ]\n }\n\n ]\n },\n \"keywords\" : {\n \"groups\" : [ \"mobile-phone\" ]\n },\n \"predictions\" : {\n \"models\" : {\n \"sales-lead\" : {\n \"output\" : \"extended.sales-followup\"\n },\n \"not-a-sales-lead\" : {\n \"output\" : \"extended.sales-ignore\"\n }\n }\n },\n \"publish\" : {\n \"callbacks\" : [\n \"https://api.example.org/callbacks/{mediaId}\"\n ]\n }\n }\n}\n" "displayName": "configuration" "metadata": "description": "Metadata about the file being posted." "type": "file" "required": false "repeat": false "example": "{\n \"metadata\": {\n \"external\" : {\n \"id\" : \"abc12312321412342315324563443\"\n },\n \"extended\" : {\n \"customer\" : \"John Doe\",\n \"channel\" : \"1 (800) EXAMPLE\",\n \"IVR\" : [ \"existing customer\", \"account services\", \"change my address\" ]\n }\n }\n}\n" "displayName": "metadata" "transcript": "description": "attached transcript" "type": "file" "required": false "repeat": false "displayName": "transcript"
resources.media.mediaId(mediaId).transcripts
Collection of transcripts available for this media item.
var resource = clientresourcesmediatranscripts;
GET
Get available transcripts.
resource;
resources.media.mediaId(mediaId).transcripts.transcriptId(transcriptId)
- transcriptId string, default: latest
var resource = clientresourcesmediatranscripts;
GET
Get a specific transcript.
resource;
resources.media.mediaId(mediaId).progress
Collection of processing phases.
var resource = clientresourcesmediaprogress;
GET
Get progress phases.
resource;
resources.media.mediaId(mediaId).streams
Streaming formats for uploaded media.
var resource = clientresourcesmediastreams;
GET
Get available media URLs.
resource;
resources.media.mediaId(mediaId).streams.original
Redirects to the original version of the file.
var resource = clientresourcesmediastreamsoriginal;
GET
resource;
Query Parameters
resource;
- access_token string, default: WLtrGY1UB1VUXkDaf0LSxDIhIWb-z4TSS8tERTMMvAjnCiRgRoa9AF125YRjITrhKAMkh2TtmhR-qelXK9XteA
Used to send a valid OAuth 2 Bearer token.
resources.media.mediaId(mediaId).metadata
The metadata for the media item.
var resource = clientresourcesmediametadata;
GET
Get the media metadata.
resource;
PUT
Update the media metadata.
resource;
Body
application/json
resources.definitions
Allows definition of complex behaviors or reusable data sets.
var resource = clientresourcesdefinitions;
GET
resource;
resources.definitions.keywords
var resource = clientresourcesdefinitionskeywords;
GET
Get definition types for keywords.
resource;
resources.definitions.keywords.groups
Define keyword groups for spotting important topics.
var resource = clientresourcesdefinitionskeywordsgroups;
GET
Get all defined keyword groups.
resource;
resources.definitions.keywords.groups.groupId(groupId)
- groupId string
A group of a set of related keywords.
var resource = clientresourcesdefinitionskeywordsgroups;
GET
Get the keyword group.
resource;
PUT
Create or update group from a set of keywords.
resource;
Body
application/json
DELETE
Delete this keyword group.
resource;
resources.definitions.transcripts
var resource = clientresourcesdefinitionstranscripts;
GET
Get definition types for transcripts.
resource;
resources.definitions.transcripts.vocabularies
Define custom vocabularies for more accurate transcription.
var resource = clientresourcesdefinitionstranscriptsvocabularies;
GET
Get all defined custom vocabularies.
resource;
resources.definitions.transcripts.vocabularies.vocabularyId(vocabularyId)
- vocabularyId string
A custom vocabulary based on a set of documents or recordings.
var resource = clientresourcesdefinitionstranscriptsvocabularies;
GET
Get the custom vocabulary.
resource;
PUT
Create a custom vocabulary from a set of media.
resource;
Body
application/json
DELETE
Delete this custom vocabulary.
resource;
resources.definitions.media
var resource = clientresourcesdefinitionsmedia;
GET
Get definition types for media.
resource;
resources.definitions.media.search
Define extended metadata searchable fields.
var resource = clientresourcesdefinitionsmediasearch;
GET
Get searchable fields.
resource;
PUT
Create or update custom parameters of metadata for search.
resource;
Body
application/json
resources.definitions.predictions
var resource = clientresourcesdefinitionspredictions;
GET
Get definition types for predictions.
resource;
resources.definitions.predictions.models
Retrieve available predicitive models.
var resource = clientresourcesdefinitionspredictionsmodels;
GET
Get all available predictive models.
resource;
resources.definitions.predictions.models.modelName(modelName)
- modelName string
A predictive model.
var resource = clientresourcesdefinitionspredictionsmodels;
GET
Get the predictive model.
resource;
resources.profile
Manage profile keys.
var resource = clientresourcesprofile;
GET
Profile keys operations.
resource;
resources.profile.keys
var resource = clientresourcesprofilekeys;
GET
Returns all current Api keys for current user.
resource;
POST
Create a new Api key for the current user.
resource;
Body
application/json
resources.profile.keys.keyId(keyId)
- keyId string
var resource = clientresourcesprofilekeys;
GET
Get information about this Api key.
resource;
DELETE
Delete and revoke this Api key.
resource;
Custom Resources
You can make requests to a custom path in the API using the #resource(path)
method.
client;
License
Apache 2.0