BessemerAlliance / speechmatics

Speechmatics API for Node.js
https://speechmatics.com/api-details
MIT License
3 stars 7 forks source link

Option to set `notification` to `none`? #3

Open pietrop opened 6 years ago

pietrop commented 6 years ago

First of all thank you soo much for a great module, as made it very straightforward to integrate speechmatics into my project autoEdit.io.

I was wondering if it was possible to change option to set notification to none when creating a transcription job? As at the moment seems to be default to email, and every time I upload something through the module I then get an email notification.

Happy to do a pull request with the change if that makes it easier for you, but could use some pointers on where to make the changes in your index.js file.


For context some more details from speechmatics API documentation

'notification': (optional) how you would like to be notified of your job finishing (email / none / callback). Defaults to 'email'. e.g., -F 'notification=callback' -F 'callback=http://your_url.com/transcript_callback'

'notification_email_address': (optional) alternative email address to use in the notification. Defaults to email used during registration if this optional argument is unused. Requires notification type to be set to 'email'. e.g -F 'notification_email_address=myalternate@address.com'

'callback': (only if notification is set to callback) if set and notification set to 'callback', the Speechmatics service will make a POST request to this URL when the job completes, including the full JSON transcript in a file attachment (named data_file, accessible for example in JavaScript by request.files.get('data_file')) along with the job id as a parameter (for example, http://www.example.com/transcript_callback?id=1). The URL callback will be attempted with a 10s timeout. If it fails, it will be retried with a 20s timeout and if it fails again, with a 30s timeout. If the URL callback fails three times, an email with an error message including the HTTP return code (if any) will be sent to the user's email address..