Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DC-251 Added explanation and code example for webhookUrl #467

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 38 additions & 3 deletions docs/async-api/overview/audio/post-audio-url.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ Parameter | Description
```confidenceThreshold``` | Double, optional <br/><br/> Minimum confidence score that you can set for an API to consider it as a valid insight (action items, follow-ups, topics, and questions). It should be in the range <=0.5 to <=1.0 (i.e., greater than or equal to `0.5` and less than or equal to `1.0`.). The default value is `0.5`. <br/><br/> Example: `"confidenceThreshold": 0.6`
```detectPhrases```| Boolean, optional <br/><br/> It shows Actionable Phrases in each sentence of conversation. These sentences can be found using the Conversation's Messages API. Default value is `false`. <br/><br/> Example: `"detectPhrases": true`
```name``` | String, optional <br/><br/> Your meeting name. Default name set to `conversationId`. <br/><br/> Example: `name: "Sales call"`, `name: "Customer call"`.
```webhookUrl``` | String, optional <br/><br/> Webhook URL on which job updates to be sent. This should be after making the API request. See the [Webhook section](/docs/async-api/overview/text/post-text#webhookurl) for more. <br/><br/> Example: `"""jobId"": ""9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"", ""status"": ""in_progress"""`
```webhookUrl``` | String, optional <br/><br/> Webhook URL on which job updates to be sent. This should be after making the API request. See the [Webhook section](/docs/async-api/overview/text/post-text#webhookurl) for more. <br/><br/> Example: `'webhookUrl': "https://yourdomain.com/jobs/callback"`
```entities``` | Object, optional <br/><br/> Input custom entities which can be detected in conversation using [Entities API](/docs/conversation-api/entities). <br/><br/> Example: `"entities": "customType": "Company Executives", "value": "Marketing director", "text": "Marketing director"`
```detectEntities``` | Boolean, optional <br/><br/> Default value is `false`. If not set the [Entities API](/docs/conversation-api/entities) will not return any entities from the conversation. <br/><br/> Example: `"detectEntities": true`
```languageCode```| String, optional <br/><br/> We accept different languages. Please [check language Code](/docs/async-api/overview/async-api-supported-languages) as per your requirement. <br/><br/> Example: `"languageCode": "en-US"`
Expand Down Expand Up @@ -400,9 +400,9 @@ So, if you send a 120-second file with 3 speaker separated channels, the total d
### Using Webhook
---

The `webhookUrl` will be used to send the status of job created for uploaded audio URL. Every time the status of the job changes it will be notified on the Webhook Url.
The `webhookUrl` will be used to send the status of the job created for uploaded audio URL. Every time the status of the job changes it will be notified on the Webhook Url. The user's server should respond with the status code 200 on receiving the `webhookUrl` update. This will prevent Symbl from resending the same update.

##### Code Example
##### Sample Response

```js
{
Expand All @@ -416,6 +416,41 @@ Field | Description
```jobId``` | ID to be used with [Job API](/docs/async-api/overview/jobs-api). <br/><br/> Example: `"jobId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"`
```status``` | Current status of the job. (Valid statuses: [ `scheduled`, `in_progress`, `completed`, `failed` ]) <br/><br/> Example: `"status": "in_progress"`

##### Sample User Server

Let's say your server runs on `localhost:9000`, then use `ngrok` to make your localhost and the "api" handle the Symbl Async API request by printing the events received from the request.
Here is a sample code that simulates a local server "api" endpoint for `webhookUrl`:

```js
const express = require('express');
const app = express();
app.listen(9000, () => console.log('Listening at 9000'));
app.use(express.static('public'));
app.use(express.json({limit:'1mb'}));
app.post('/api',(request,response) => {
let currentDate = new Date();
let data = request.body;
console.log('datetime:',currentDate,' jobId:',data.id,' status:', data.status);
response.json({
status:200
});
}
)
```

Run `ngrok http 9000` and then pass the url `https://.../` with the "api" string address to the Async request through `webhookUrl`. For example: `https://0bd1-2601-600-8780-9280-181a-4525-3a3f-882d.ngrok.io/api`. Run your localhost server and then send the Async API request through the ngrok `webhookUrl`. You will receive the following status from your localhost server:

```shell
Listening at 9000

datetime: 2021-11-10T03:29:34.998Z jobId: f4535f3f-9b7c-458b-a47a-cc84b916d9e6 status: scheduled

datetime: 2021-11-10T03:29:35.526Z jobId: f4535f3f-9b7c-458b-a47a-cc84b916d9e6 status: in_progress

datetime: 2021-11-10T03:31:39.777Z jobId: f4535f3f-9b7c-458b-a47a-cc84b916d9e6 status: completed
```


### API Limit Error
---
```js
Expand Down
40 changes: 37 additions & 3 deletions docs/async-api/overview/audio/post-audio.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ Parameter | Description
```confidenceThreshold``` | Double, optional <br/><br/> Minimum confidence score that you can set for an API to consider it as a valid insight (action items, follow-ups, topics, and questions). It should be in the range <=0.5 to <=1.0 (i.e., greater than or equal to `0.5` and less than or equal to `1.0`.). The default value is `0.5`. <br/><br/> Example: `"confidenceThreshold": 0.6`
```detectPhrases```| Boolean, optional <br/><br/> It shows Actionable Phrases in each sentence of conversation. These sentences can be found using the Conversation's Messages API. Default value is `false`. <br/><br/> Example: `"detectPhrases": true`
```name``` | String, optional <br/><br/> Your meeting name. Default name set to `conversationId`. <br/><br/> Example: `name: "Sales call"`, `name: "Customer call"`.
```webhookUrl``` | String, optional <br/><br/> Webhook URL on which job updates to be sent. This should be after making the API request. See the [Webhook section](/docs/async-api/overview/text/post-text#webhookurl) for more. <br/><br/> Example: `"""jobId"": ""9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"", ""status"": ""in_progress"""`
```webhookUrl``` | String, optional <br/><br/> Webhook URL on which job updates to be sent. This should be after making the API request. See the [Webhook section](/docs/async-api/overview/text/post-text#webhookurl) for more. <br/><br/> Example: `'webhookUrl': "https://yourdomain.com/jobs/callback"`
```entities``` | Object, optional <br/><br/> Input custom entities which can be detected in conversation using [Entities API](/docs/conversation-api/entities). <br/><br/> Example: `"entities": "customType": "Company Executives", "value": "Marketing director", "text": "Marketing director"`
```detectEntities``` | Boolean, optional <br/><br/> Default value is `false`. If not set the [Entities API](/docs/conversation-api/entities) will not return any entities from the conversation. <br/><br/> Example: `"detectEntities": true`
```languageCode```| String, optional <br/><br/> We accept different languages. Please [check language Code](/docs/async-api/overview/async-api-supported-languages) as per your requirement. <br/><br/> Example: `"languageCode": "en-US"`
Expand Down Expand Up @@ -326,9 +326,9 @@ So, if you send a 120-second file with 3 speaker separated channels, the total d
### Using Webhook
---

The `webhookUrl` will be used to send the status of job created for uploaded audio URL. Every time the status of the job changes it will be notified on the Webhook Url.
The `webhookUrl` will be used to send the status of the job created for uploaded audio URL. Every time the status of the job changes it will be notified on the Webhook Url. The user's server should respond with the status code 200 on receiving the `webhookUrl` update. This will prevent Symbl from resending the same update.

##### Code Example
##### Sample Response

```js
{
Expand All @@ -342,6 +342,40 @@ Field | Description
```jobId``` | ID to be used with [Job API](/docs/async-api/overview/jobs-api). <br/><br/> Example: `"jobId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"`
```status``` | Current status of the job. (Valid statuses: [ `scheduled`, `in_progress`, `completed`, `failed` ]) <br/><br/> Example: `"status": "in_progress"`

##### Sample User Server

Let's say your server runs on `localhost:9000`, then use `ngrok` to make your localhost and the "api" handle the Symbl Async API request by printing the events received from the request.
Here is a sample code that simulates a local server "api" endpoint for `webhookUrl`:

```js
const express = require('express');
const app = express();
app.listen(9000, () => console.log('Listening at 9000'));
app.use(express.static('public'));
app.use(express.json({limit:'1mb'}));
app.post('/api',(request,response) => {
let currentDate = new Date();
let data = request.body;
console.log('datetime:',currentDate,' jobId:',data.id,' status:', data.status);
response.json({
status:200
});
}
)
```

Run `ngrok http 9000` and then pass the url `https://.../` with the "api" string address to the Async request through `webhookUrl`. For example: `https://0bd1-2601-600-8780-9280-181a-4525-3a3f-882d.ngrok.io/api`. Run your localhost server and then send the Async API request through the ngrok `webhookUrl`. You will receive the following status from your localhost server:

```shell
Listening at 9000

datetime: 2021-11-10T03:29:34.998Z jobId: f4535f3f-9b7c-458b-a47a-cc84b916d9e6 status: scheduled

datetime: 2021-11-10T03:29:35.526Z jobId: f4535f3f-9b7c-458b-a47a-cc84b916d9e6 status: in_progress

datetime: 2021-11-10T03:31:39.777Z jobId: f4535f3f-9b7c-458b-a47a-cc84b916d9e6 status: completed
```


### API Limit Error
---
Expand Down
41 changes: 38 additions & 3 deletions docs/async-api/overview/audio/put-audio-url.md
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ Parameter | Description
```confidenceThreshold``` | Double, optional <br/><br/> Minimum confidence score that you can set for an API to consider it as a valid insight (action items, follow-ups, topics, and questions). It should be in the range <=0.5 to <=1.0 (i.e., greater than or equal to `0.5` and less than or equal to `1.0`.). The default value is `0.5`. <br/><br/> Example: `"confidenceThreshold": 0.6`
```detectPhrases```| Boolean, optional <br/><br/> It shows Actionable Phrases in each sentence of conversation. These sentences can be found using the Conversation's Messages API. Default value is `false`. <br/><br/> Example: `"detectPhrases": true`
```name``` | String, optional <br/><br/> Your meeting name. Default name set to `conversationId`. <br/><br/> Example: `name: "Sales call"`, `name: "Customer call"`.
```webhookUrl``` | String, optional <br/><br/> Webhook URL on which job updates to be sent. This should be after making the API request. See the [Webhook section](/docs/async-api/overview/text/post-text#webhookurl) for more. <br/><br/> Example: `"""jobId"": ""9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"", ""status"": ""in_progress"""`
```webhookUrl``` | String, optional <br/><br/> Webhook URL on which job updates to be sent. This should be after making the API request. See the [Webhook section](/docs/async-api/overview/text/post-text#webhookurl) for more. <br/><br/> Example: `'webhookUrl': "https://yourdomain.com/jobs/callback"`
```entities``` | Object, optional <br/><br/> Input custom entities which can be detected in conversation using [Entities API](/docs/conversation-api/entities). <br/><br/> Example: `"entities": "customType": "Company Executives", "value": "Marketing director", "text": "Marketing director"`
```detectEntities``` | Boolean, optional <br/><br/> Default value is `false`. If not set the [Entities API](/docs/conversation-api/entities) will not return any entities from the conversation. <br/><br/> Example: `"detectEntities": true`
```languageCode```| String, optional <br/><br/> We accept different languages. Please [check language Code](/docs/async-api/overview/async-api-supported-languages) as per your requirement. <br/><br/> Example: `"languageCode": "en-US"`
Expand Down Expand Up @@ -412,9 +412,9 @@ So, if you send a 120-second file with 3 speaker separated channels, the total d
### Using Webhook
---

The `webhookUrl` will be used to send the status of job created for uploaded audio url. Every time the status of the job changes it will be notified on the WebhookUrl.
The `webhookUrl` will be used to send the status of the job created for uploaded audio URL. Every time the status of the job changes it will be notified on the Webhook Url. The user's server should respond with the status code 200 on receiving the `webhookUrl` update. This will prevent Symbl from resending the same update.

##### Code Example
##### Sample Response

```js
{
Expand All @@ -428,6 +428,41 @@ Field | Description
```jobId``` | ID to be used with [Job API](/docs/async-api/overview/jobs-api). <br/><br/> Example: `"jobId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"`
```status``` | Current status of the job. (Valid statuses: [ `scheduled`, `in_progress`, `completed`, `failed` ]) <br/><br/> Example: `"status": "in_progress"`

##### Sample User Server

Let's say your server runs on `localhost:9000`, then use `ngrok` to make your localhost and the "api" handle the Symbl Async API request by printing the events received from the request.
Here is a sample code that simulates a local server "api" endpoint for `webhookUrl`:

```js
const express = require('express');
const app = express();
app.listen(9000, () => console.log('Listening at 9000'));
app.use(express.static('public'));
app.use(express.json({limit:'1mb'}));
app.post('/api',(request,response) => {
let currentDate = new Date();
let data = request.body;
console.log('datetime:',currentDate,' jobId:',data.id,' status:', data.status);
response.json({
status:200
});
}
)
```

Run `ngrok http 9000` and then pass the url `https://.../` with the "api" string address to the Async request through `webhookUrl`. For example: `https://0bd1-2601-600-8780-9280-181a-4525-3a3f-882d.ngrok.io/api`. Run your localhost server and then send the Async API request through the ngrok `webhookUrl`. You will receive the following status from your localhost server:

```shell
Listening at 9000

datetime: 2021-11-10T03:29:34.998Z jobId: f4535f3f-9b7c-458b-a47a-cc84b916d9e6 status: scheduled

datetime: 2021-11-10T03:29:35.526Z jobId: f4535f3f-9b7c-458b-a47a-cc84b916d9e6 status: in_progress

datetime: 2021-11-10T03:31:39.777Z jobId: f4535f3f-9b7c-458b-a47a-cc84b916d9e6 status: completed
```


### API Limit Error

```js
Expand Down
41 changes: 38 additions & 3 deletions docs/async-api/overview/audio/put-audio.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ Parameter | Description
```confidenceThreshold``` | Double, optional <br/><br/> Minimum confidence score that you can set for an API to consider it as a valid insight (action items, follow-ups, topics, and questions). It should be in the range <=0.5 to <=1.0 (i.e., greater than or equal to `0.5` and less than or equal to `1.0`.). The default value is `0.5`. <br/><br/> Example: `"confidenceThreshold": 0.6`
```detectPhrases```| Boolean, optional <br/><br/> It shows Actionable Phrases in each sentence of conversation. These sentences can be found using the Conversation's Messages API. Default value is `false`. <br/><br/> Example: `"detectPhrases": true`
```name``` | String, optional <br/><br/> Your meeting name. Default name set to `conversationId`. <br/><br/> Example: `name: "Sales call"`, `name: "Customer call"`.
```webhookUrl``` | String, optional <br/><br/> Webhook URL on which job updates to be sent. This should be after making the API request. See the [Webhook section](/docs/async-api/overview/text/post-text#webhookurl) for more. <br/><br/> Example: `"""jobId"": ""9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"", ""status"": ""in_progress"""`
```webhookUrl``` | String, optional <br/><br/> Webhook URL on which job updates to be sent. This should be after making the API request. See the [Webhook section](/docs/async-api/overview/text/post-text#webhookurl) for more. <br/><br/> Example: `'webhookUrl': "https://yourdomain.com/jobs/callback"`
```entities``` | Object, optional <br/><br/> Input custom entities which can be detected in conversation using [Entities API](/docs/conversation-api/entities). <br/><br/> Example: `"entities": "customType": "Company Executives", "value": "Marketing director", "text": "Marketing director"`
```detectEntities``` | Boolean, optional <br/><br/> Default value is `false`. If not set the [Entities API](/docs/conversation-api/entities) will not return any entities from the conversation. <br/><br/> Example: `"detectEntities": true`
```languageCode```| String, optional <br/><br/> We accept different languages. Please [check language Code](/docs/async-api/overview/async-api-supported-languages) as per your requirement. <br/><br/> Example: `"languageCode": "en-US"`
Expand Down Expand Up @@ -331,9 +331,9 @@ So, if you send a 120-second file with 3 speaker separated channels, the total d
### Using Webhook
---

The `webhookUrl` will be used to send the status of job created for uploaded audio URL. Every time the status of the job changes it will be notified on the Webhook Url.
The `webhookUrl` will be used to send the status of the job created for uploaded audio URL. Every time the status of the job changes it will be notified on the Webhook Url. The user's server should respond with the status code 200 on receiving the `webhookUrl` update. This will prevent Symbl from resending the same update.

##### Code Example
##### Sample Response

```js
{
Expand All @@ -347,6 +347,41 @@ Field | Description
```jobId``` | ID to be used with [Job API](/docs/async-api/overview/jobs-api). <br/><br/> Example: `"jobId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"`
```status``` | Current status of the job. (Valid statuses: [ `scheduled`, `in_progress`, `completed`, `failed` ]) <br/><br/> Example: `"status": "in_progress"`

##### Sample User Server

Let's say your server runs on `localhost:9000`, then use `ngrok` to make your localhost and the "api" handle the Symbl Async API request by printing the events received from the request.
Here is a sample code that simulates a local server "api" endpoint for `webhookUrl`:

```js
const express = require('express');
const app = express();
app.listen(9000, () => console.log('Listening at 9000'));
app.use(express.static('public'));
app.use(express.json({limit:'1mb'}));
app.post('/api',(request,response) => {
let currentDate = new Date();
let data = request.body;
console.log('datetime:',currentDate,' jobId:',data.id,' status:', data.status);
response.json({
status:200
});
}
)
```

Run `ngrok http 9000` and then pass the url `https://.../` with the "api" string address to the Async request through `webhookUrl`. For example: `https://0bd1-2601-600-8780-9280-181a-4525-3a3f-882d.ngrok.io/api`. Run your localhost server and then send the Async API request through the ngrok `webhookUrl`. You will receive the following status from your localhost server:

```shell
Listening at 9000

datetime: 2021-11-10T03:29:34.998Z jobId: f4535f3f-9b7c-458b-a47a-cc84b916d9e6 status: scheduled

datetime: 2021-11-10T03:29:35.526Z jobId: f4535f3f-9b7c-458b-a47a-cc84b916d9e6 status: in_progress

datetime: 2021-11-10T03:31:39.777Z jobId: f4535f3f-9b7c-458b-a47a-cc84b916d9e6 status: completed
```


### API Limit Error
---
```js
Expand Down
Loading