e-api-emotion
v1.0.0
Published
Browser and node module for making API requests against [eAPI_Emotion](https://mocksvc.mulesoft.com/mocks/1b4c387d-a536-4bc0-85d1-f533971b8314).
Downloads
3
Readme
eAPI_Emotion
Browser and node module for making API requests against eAPI_Emotion.
Please note: This module uses Popsicle to make API requests. Promises must be supported or polyfilled on all target environments.
Installation
npm install e-api-emotion --save
bower install e-api-emotion --save
Usage
Node
var EApiEmotion = require('e-api-emotion');
var client = new EApiEmotion();
Browsers
<script src="e-api-emotion/index.js"></script>
<script>
var client = new EApiEmotion();
</script>
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 = new EApiEmotion({ ... });
client.options = { ... };
client.resource('/').get(null, {
baseUri: 'http://example.com',
headers: {
'Content-Type': 'application/json'
}
});
Base URI
You can override the base URI by setting the baseUri
property, or initializing a client with a base URI. For example:
new EApiEmotion({
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:
client.options.baseUriParameters.version = '1';
Resources
All methods return a HTTP request instance of Popsicle, which allows the use of promises (and streaming in node).
resources.emotion.detect
startet den Erkennungs- und Feedbackprozess anhand des uebermittelten Fotos aus.
var resource = client.resources.emotion.detect;
POST
resource.post().then(function (res) { ... });
Query Parameters
resource.post(null, { query: { ... } });
pictureUrl string
email string
detectionEndpoint string, one of (Azure, AWS), default: Azure
jjRobotAppId string
Custom Resources
You can make requests to a custom path in the API using the #resource(path)
method.
client.resource('/example/path').get();
License
Apache 2.0