Dev Portal Landing Page (6)

REST Web Services Introduction

The Alianza web service APIs are a collection of JSON RESTful web methods that can be leveraged by service providers to interact with their customer accounts. The web methods are grouped into various web services in a logical manner by the object the methods operate on. A listing of these services and their URL parameters can be found below.

Applications will interact with the Alianza Web Services API by passing REST/JSON requests via HTTP. To access any of the Alianza Web Services, point the application to the following URL:

  • Development Environment: api.b2.alianza.com
  • Production (Live) Environment: api.alianza.com

 

Alianza Web Services

See Alianza API documentation for a complete and up-to-date list of web services.

Service URL Parameters
Account https:///v2/partition//account
Calling Plan

https:///v2/partition//callingplanproduct

Device https:///v2/partition//account//user//device
End User https:///v2/partition//account//user
Report https:///v2/partition//report/
SIP Trunk https:///v2/partition//account//siptrunk
Telephone Number https:///v2/partition//telephonenumber
Voicemail https:///v2/partition//account//user//voicemail
  • Can be replaced by the environment to perform the operation to. For example, If posting the requests to production the URL would look as follows: https://api.alianza.com/v2/partition....
  • This variable is unique for your partition in the Alianza platform. Please contact your client services manager to obtain your partitionId.
  • Unique identifier for an account in our database. This id can be obtained by searching for an account using the Account webservice. Once obtained, it can be used in all other operations for that account.
  • Unique identifier for a user in our database. This id can be obtained by searching for users in the account using the End User webservice to obtain all users on an account. Once obtained, it can be used in all other operations for that user.

 

HTTP Verbs

Each request specifies a certain HTTP verb, or method, in the request header. HTTP verbs tell the server what to do with the data identified by the URL. The request can optionally contain additional information in its body, which might be required to perform the operation.

The most important verbs to using for using RESTful API are GET, POST, PUT, and DELETE.

Service URL Parameters
Account https:///v2/partition//account
Calling Plan

https:///v2/partition//callingplanproduct

Device https:///v2/partition//account//user//device
End User https:///v2/partition//account//user
Report https:///v2/partition//report/
SIP Trunk https:///v2/partition//account//siptrunk
Telephone Number https:///v2/partition//telephonenumber
Voicemail https:///v2/partition//account//user//voicemail

Web Service Security

In order to perform any operation an AuthToken must be obtained. The AuthToken is provided back by making a POST request to the authorize End Point and providing a valid admin portal username and password. For example:

https://api.alianza.com/v2/authorize POST JSON:

 {
    “username” : “user@email.com”,
    “password” : “thisISmyP4ssw0rd”
 }

Response

The response includes details about this management user and an AuthToken that can be used as X-AUTH-TOKEN in the header of the request. This Auth Token is valid for a certain period of time, similar to the time a admin portal user can be logged in the portal, and once obtained it can be used for an unlimited number of web service requests.

 {
    "authToken": "xRyqjCTfSK3tl5W6aa61xg",
    "userId": "9sPet0RZ5mnniO271ojg",
    "userType": "User",
    "username": "user@email.com",
    "firstName": "User",
    "lastName": "Test",
    "partitionId": "asdk12387asdhjkASD1",
    "partitionName": "TEST CUSTOMER",
    "permissions": {
          "Account": "DELETE",
          "AccountHistory": "READ",
          "AccountCallHistory": "READ",
          "AccountBulkStatuses": "EDIT",
          "PhoneNumber": "READ",
          "PhoneNumberServiceActivation": "DELETE",
          "PhoneNumberInventory": "EDIT",
          "Product": "READ",
          "ProductCallingPlan": "DELETE",
          "ProductGroups": "DELETE",
          "ProductUsers": "DELETE",
          "Reports": "READ",
          "ANY_MANAGEMENT_USER": "DELETE",
          "ANY_ALIANZA_USER": "DELETE"
        },
    "mustChangePassword": false
  }

HTTP Response Codes

HTTP response codes standardize a way of informing the client about the result of the request. Here are some HTTP response codes, which are often used with REST:

200 OK

This response code indicates that the request was successful.

201 Created

This indicates the request was successful and a resource was created. It is used to confirm success of a PUT or POST request.

400 Bad Request

The request was malformed. This happens especially with POST and PUT requests, when the data does not pass validation, or is in the wrong format.

404 Not Found

This response indicates that the required resource could not be found. This is generally returned to all requests which point to a URL with no corresponding resource.

401 Unauthorized

This error indicates that you need to perform authentication before accessing the resource.

500 Internal Server Error

When all else fails; generally, a 500 response is used when processing fails due to unanticipated circumstances on the server side, which causes the server to error out.

SIP Trunk https:///v2/partition//account//siptrunk
Telephone Number https:///v2/partition//telephonenumber
Voicemail https:///v2/partition//account//user//voicemail

How to Access Datafeeds (SFTP Server)

The Alianza Cloud Voice Platform integrates with others systems both via the REST API and datafeeds. Datafeeds such as CDRs (Call Detail Records) are uploaded to an SFTP server for the Service Provider/integration to access and then process.

In order to access your SFTP, you will need a valid username and password. Please contact Alianza to obtain your SFTP credentials.

Login Information

Production and Beta credentials are different, and Alianza uses port 10022 for access to SFTP which is different from the commonly used port.

Production Environment

Host Name sftp://datafeed.alianza.com
Port 10022
Username Contact Alianza
Password Contact Alianza

Beta Environment

Host Name sftp://datafeed.b2.alianza.com
Port 10022
Username Contact Alianza
Password Contact Alianza

API Certification

Our integrations undergo a certification process to ensure everything works smoothly.

Reference Values

Learn more about our JSON field definition and ENUM reference values.

API Guides

Explore our comprehensive documentation for integration capabilities and instructions.