API Guide

From Evo Voice
Jump to: navigation, search

Introduction

The Evo Voice communication platform is 100% API driven. Every single thing that you can do via the dashboard, you can do from the API. In fact, if you open up your browser's dev tools and watch the network monitor, you can see exactly which API calls each page makes

ClipCapIt-201221-075225.PNG

Getting Started

To get started using the Evo Voice API, you will need an Evo Voice account/sign in. The Evo Voice API uses the same credentials that you use to login to the Evo Voice dashboard. Once you have these credentials and your account ID (ask Evo for this if you don't know it), please move on to the next section.

We will be using Postman to show API examples below, but you can use any HTTP environment that you are comfortable with

API Basics

The complete list of API methods available is listed here:

https://evovoice.io/metadata

However, the most popular include

Buying a phone number https://evovoice.io/json/metadata?op=BuyPhoneNumber

Listing existing endpoints https://evovoice.io/json/metadata?op=ListEndpoints

Creating a new customer https://evovoice.io/json/metadata?op=NewCustomer

Get Call History https://evovoice.io/json/metadata?op=ListSessions

The Evo Voice API is loosely based around REST with the following conventions

  1. Any API request which results in a new entity being created will use the POST verb
  2. Any API request which modifies an existing entity will use the PATCH verb
  3. Any API request which returns entities without making changes will use the GET verb
  4. Any API request which deletes entities will use the DELETE verb

There are times when we have to deviate from these rules but in general, the above will hold true for most requests

Example Endpoint

Let's take a look at an example endpoint metadata so that we can cover the basic fields

ClipCapIt-201221-091036.PNG

At the very top you will see that this endpoint uses the HTTP GET verb at /sessions. The full URL would be https://evovoice.io/sessions

Below the URL, you can see the query parameters that are available. Since these docs are auto generated, there are multiple sections of query parameters, do not worry about the ListRequest<T> just treat all the sections as a single large section of fields available.

Below all the query params, there is an explanation of the various fields in the response, e.g.

ClipCapIt-201221-091250.PNG

And finally at the very end is an example usage:

ClipCapIt-201221-091314.PNG

Content Type

The Evo Voice API supports a lot of different content types but in general, we recommend and support application/json

Any POSTs/PATCHs which you make should have a Content-Type header of application/json and you should ALWAYS send an Accept: application/json in order to get JSON responses back

Authentication

There are two ways that you can authenticate to the Evo Voice API (Basic and Cookies)

Basic Authentication

Basic authentication sends the user/pass in HTTP headers, the following example will use Basic auth to pull a list of endpoints

ClipCapIt-201221-090253.PNG
ClipCapIt-201221-090308.PNG

And here you can see that we get our results correctly:

ClipCapIt-201221-090325.PNG

Cookie Authentication

Cookie based authentication works by first sending a POST to the authenticate endpoint

https://evovoice.io/json/metadata?op=Authenticate

E.g.


ClipCapIt-201221-090727.PNG


Please note that the provider field is required and should always be set to credentials

You will note that there were several cookies returned back including ss-id and ss-pid. These must be provided on all subsequent requests in order for authentication to work properly since this is cookie based.

Conclusion

In general, the Evo Voice API is very easy to use. There are a lot of endpoints available so it is recommended to read the description for each endpoint and if you have any questions, shoot us an email at support@evo.tech