Skip to content

barinali/apidaze-js

 
 

Repository files navigation

APIdaze Javascript API

This library provides video conferences, automated voice responses, selecting dialtone option and more.
User will not be able to select phone number. Instead he will call an "External Script" which is a XML definition of what will happen during the call. External Scripts are stored on APIdaze server.

For use cases where user can type phone number consider REST API.

Installation

Either execute in your project directory
npm install apidaze-js
and add to your code
const APIdaze = require('apidaze-js')

or add a html tag
<script src="https://api4.apidaze.io/javascript/releases/APIdaze-3.0.0-dev-master.js" />

Usage

Make sure you can access this page that is used to define External Scripts.
If you don't have account, you can create one here.
To initialize a client, follow these instructions.
And to read more about possibilites of External Scripts, go here.

How to run examples

  1. Visit https://backoffice.voipinnovations.com/ProgrammableTelco/ExternalScripts.aspx
  2. Click create new script button
  3. Enter name of your choice and this content of External Script
<document>
  <work>
    <answer />
    <wait>1</wait>
    <speak>Welcome, you are joining the conference.</speak>
    <conference>test</conference>
    <hangup />
  </work>
</document>

4. Click create script, wait for cofirmation, close the editor
5. Find script by the name and copy the visible apiKey (c7fee939 on screenshot) 6. Clone repository git clone https://github.com/apidaze/apidaze-js.git
7. Install npm dependencies cd apidaze-js and npm install
8. Start a webserver npm run start
9. Open https://localhost:9000
10. Warning about missing certificate will be displayed, click "advanced" and "proceed to localhost (unsafe)"
11. Select "API key check" from list of examples
12. Type apiKey from step 4. and click "check" button

If all went good, result should look like this

How to contribute

  1. Fork this repository
  2. Make a copy of file cypress/config.template.js named cypress/config.js and inside its content write apiKey from step 4. of How to run examples
  3. Work on your change
  4. When ready, please verify that code is matching linter and tests are passing by running npm run start and in separate console: npm run test:all
  5. If integration tests are failing use npm run cypress to find a reason
  6. When all tests are passing create a pull request

About

APIdaze JavaScript API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%