Customer Management APIs are meant for adding new customers, listing, searching, editing and deleting them. These APIs has 2 different type of Access, viz. HTTP Base Authentication and OAuth2. Choose on that best suits your development needs. In most cases, codes are shown with OAuth2 Access Token.

Table of Contents

Get Customer Information

This API is used to get a Customer’s Information for a given Customer Id.

  • API Route: https://api.enablex.io/ucaas/v1/customers/{{$RESET_KEY}}
  • HTTP Request: POST
  • Access Mechanism: HTTP Basic Authentication, OAauth2
  • Role Based Accessibility;
    • Reseller (Access to Customer information under the Reseller)
    • Admin / Tenant (Access to Resellers & Direct Customer information)

Request Example (OAuth2):

GET https://api.enablex.io/ucaas/v1/customers/{{$CUSTOMER_ID}}
Content-Type: application/json
Authorization: Token ACCESS_TOTKEN

Request Example (HTTP Basic Authentication):

GET https://api.enablex.io/ucaas/v1/customers/{{$CUSTOMER_ID}}
Content-Type: application/json
Authorization: Basic BASE64_AUTH_STRING

Headers Explanation:

  • Content-Type: To have application/json.
  • Authorization: To have Token Access Information

URL Placeholder Explanation:

PlaceholderDescription
CUSTOMER_IDThis is the Customer ID

Response Example:

{
  "result": 1,
  "customer": {
    "customer_id": "String",
    "customer_name": "String",
    "customer_legal_name": "String",
    "customer_code": "String",
    "customer_type": "String",
    "customer_type_ex": "String",
    "individual": "Boolean",
    "contact_name": "String",
    "contact_email": "String",
    "status": "String",
    "status_ex": "String",
    "office_address": {
      "address_1": "String",
      "address_2": "String",
      "address_3": "String",
      "city": "String",
      "state": "String",
      "country": "String",
      "zipcode": "String",
      "country_id": "String"
    },
    "billing_address": {
      "address_1": "String",
      "address_2": "String",
      "address_3": "String",
      "city": "String",
      "state": "String",
      "country": "String",
      "zipcode": "String",
      "country_id": "String"
    },
    "track": {
      "added": "Date",
      "modified": "Date",
      "activated": "Date",
      "suspended": "Date",
      "closed": "Date"
    }
  }
}

Response Explanation (Only for important Object and Keys) :

Object/KeyDescription
customerObject. This Object carries information of the Customer
customer.customer_codeString. Enum: T, P, R, A
customer.customer_type_exString. Customer Code explained. T=Tenant/Entity, P=Customer, R=Reseller, A=Affiliate
customer.statusString. Enum: A, S, C, U
customer.status_exString. Status Code explained. A=Active, S=Suspended, C=Closed, U=Unverified
customer.office_addressObject. This Object carries Offie Address of the Customer
customer.billing_addressObject. This Object carries Billing Address of the Customer

Note: All Date Time data in response are in UTC

Search & Get List of Customers

This API is used to get a paginated list of Customers. The API provides various filtering and sorting options.

  • API Route: https://api.enablex.io/ucaas/v1/customers
  • HTTP Request: GET
  • Access Mechanism: HTTP Basic Authentication, OAauth2
  • Filters & Sorting: Options passed as Query String to the API Route
  • Role Based Accessibility;
    • Reseller (Access to Customer information under the Reseller)
    • Admin / Tenant (Access to Resellers & Direct Customer information)

Request Example (OAuth2): Simplest Call to get first page of Customer Listing

GET https://api.enablex.io/ucaas/v1/customers
Content-Type: application/json
Authorization: Token ACCESS_TOTKEN

Request Example (OAuth2): Request with Paging, Filter and Sorting Options as Query String

GET https://api.enablex.io/ucaas/v1/customers?page={{$PAGE_NUM}}&search_by=status&search_string=A
Content-Type: application/json
Authorization: Token ACCESS_TOTKEN

Headers Explanation:

  • Content-Type: To have application/json.
  • Authorization: To have Token Access Information

URL Query String Variable Explanation:

VariableDescription
pageNumber. Optional. Default 1. Data return requested for the Page
page_numNumber. Optional. Default 10, Total Records to include in a Page
from_join_dtDate. Optional. Format: YYYY-MM-DD. Join Start Date Filter
to_join_dtDate. Optional. Format: YYYY-MM-DD. Join End Date Filter
search_byString. Optional. Required if search_string is used. Use any of the enumerated values: customer_name, customer_legal_name, customer_code, individual (true to search Individual sign-ups; false to sign-up corproates), status (A=Active, S=Suspended, C=Closed, U=Unverified)
search_stringString. Required with search_by
order_byString. Optional. Database field names. Multiple may be comma-separated
order_qualifyString. Optional. Default “asc”. Enumerated values: asc, desc

Response Example:

{
  "result": 1,
  "search": {
    "page": "Number",
    "page_length": "Number",
    "from_join_dt": "Date",
    "to_join_dt": "Date",
    "search_by": "String",
    "search_string": "String",
    "order_by": "String",
    "order_qualify": "String"
  },
  "customers": [
    {
      "customer_id": "String",
      "customer_name": "String",
      "customer_legal_name": "String",
      "customer_code": "String",
      "customer_type": "String",
      "customer_type_ex": "String",
      "individual": "Boolean",
      "contact_name": "String",
      "contact_email": "String",
      "status": "String",
      "status_ex": "String",
      "office_address": {
        "address_1": "String",
        "address_2": "String",
        "address_3": "String",
        "city": "String",
        "state": "String",
        "country": "String",
        "zipcode": "String",
        "country_id": "String"
      },
      "billing_address": {
        "address_1": "String",
        "address_2": "String",
        "address_3": "String",
        "city": "String",
        "state": "String",
        "country": "String",
        "zipcode": "String",
        "country_id": "String"
      },
      "track": {
        "added": "Date",
        "modified": "Date",
        "activated": "Date",
        "suspended": "Date",
        "closed": "Date"
      }
    }
  ]
}

Response Explanation (Only for important Object and Keys) :

Object/KeyDescription
searchObject. Contains all filter and sort options used to get the result
customersArray of Objects. Each object carries information of a Customer
customers[n].customer_codeString. Enum: T, P, R, A
customers[n].customer_type_exString.Customer Code explained. T=Tenant/Entity, P=Customer, R=Reseller, A=Affiliate
customers[n].statusString.Enum: A, S, C, U
customers[n].status_exString.Status Code explained. A=Active, S=Suspended, C=Closed, U=Unverified
customers[n].office_addressObject. This Object carries Offie Address of the Customer
customers[n].billing_addressObject. This Object carries Billing Address of the Customer

Note: All Date Time data in response are in UTC

Add New Customer

This API is used to add a New Customer.

  • API Route: https://api.enablex.io/ucaas/v1/customers
  • HTTP Request: POST
  • Access Mechanism: HTTP Basic Authentication, OAauth2
  • Role Based Accessibility;
    • Reseller (Access to add new Customer under the Reseller)
    • Admin / Tenant (Access toadd new Customer or Reseller under Tenant)

Request Example (OAuth2):

POST https://api.enablex.io/ucaas/v1/customers
Content-Type: application/json
Authorization: Token ACCESS_TOTKEN

{
  "customer_name": "String",
  "customer_legal_name": "String",
  "customer_code": "String",
  "individual": "Boolean",
  "contact_name": "String",
  "contact_email": "String",
  "office_address": {
    "address_1": "String",
    "address_2": "String",
    "address_3": "String",
    "city": "String",
    "state": "String",
    "country": "String",
    "zipcode": "String",
    "country_id": "String"
  },
  "billing_address": {
    "address_1": "String",
    "address_2": "String",
    "address_3": "String",
    "city": "String",
    "state": "String",
    "country": "String",
    "zipcode": "String",
    "country_id": "String"
  }
}

Headers Explanation:

  • Content-Type: To have application/json.
  • Authorization: To have Token Access Information

JSON Payload Explanation:

Object / KeysDescription
customer_nameString. Required. Customer Name
customer_legal_nameString. Required. Legal Entity name
customer_codeString. Optional. Code, ID or Reference from External Information System
individualBoolean. Optional. Default: false. true for Individual; and false for corporate registrations
contact_first_nameString. Required. Contact person first name
contact_last_nameString. Optional. Contact person last name
contact_emailString. Required. Contact person email address
office_addressObject. Required. Object Keys are self explanatory
office_address.address_1String. Required
office_address.address_2String. Optional
office_address.address_3String. Optional
office_address.cityString. Required
office_address.stateString. Optional
office_address.country_idString. Required. ID to be taken from Country List. Refer API
office_address.zipcodeString. Optional
billing_addressObject. Optional. Keys are similar to office_address. If omitted, office_address Object is replicated here.

Response Example:

{
  "result": 1,
  "msg": "$customer_name has been added",
  "customer": {
    "customer_id": "String",
    "customer_name": "String"
  },
  "portal_access": {
    "url": "String",
    "username": "String",
    "password": "String"
  }
}

Response Explanation (Only for important Object and Keys) :

Object/KeyDescription
resultNumber. 1=Success
msgA Text Message explaining the successful transaction
customerObject. It contains key information of the new customer
customer.customer_idString. Unique ID of the Customer
customer.customer_nameString. Name of the Customer
portal_accessObject. Portal Access Information
portal_access.urlString. Portal URL
portal_access.usernameString. Portal Login Credential: Username
portal_access.passwordString. Portal Login Credential: Password

Edit Customer Information

This API is used to edit a Customer Information. All Keys in JSON payload are optional. Use only the one which you want to edit.

  • API Route: https://api.enablex.io/ucaas/v1/customers
  • HTTP Request: PATCH
  • Access Mechanism: HTTP Basic Authentication, OAauth2
  • Role Based Accessibility;
    • Reseller (Access to add new Customer under the Reseller)
    • Admin / Tenant (Access toadd new Customer or Reseller under Tenant)

Request Example (OAuth2):

POST https://api.enablex.io/ucaas/v1/customers/{{$CUSTOMER_ID}}
Content-Type: application/json
Authorization: Token ACCESS_TOTKEN

{
  "customer_name": "String",
  "customer_legal_name": "String",
  "customer_code": "String",
  "individual": "Boolean",
  "contact_name": "String",
  "contact_email": "String",
  "office_address": {
    "address_1": "String",
    "address_2": "String",
    "address_3": "String",
    "city": "String",
    "state": "String",
    "country": "String",
    "zipcode": "String",
    "country_id": "String"
  },
  "billing_address": {
    "address_1": "String",
    "address_2": "String",
    "address_3": "String",
    "city": "String",
    "state": "String",
    "country": "String",
    "zipcode": "String",
    "country_id": "String"
  },
  "timezone_id": "String"
}

Headers Explanation:

  • Content-Type: To have application/json.
  • Authorization: To have Token Access Information

JSON Payload Explanation:

Object / KeysDescription
customer_nameString. Required. Customer Name
customer_legal_nameString. Required. Legal Entity name
customer_codeString. Optional. Code, ID or Reference from External Information System
individualBoolean. Optional. Default: false. true for Individual; and false for corporate registrations
contact_first_nameString. Required. Contact person first name
contact_last_nameString. Optional. Contact person last name
contact_emailString. Required. Contact person email address
office_addressObject. Required. Object Keys are self explanatory
office_address.address_1String. Required
office_address.address_2String. Optional
office_address.address_3String. Optional
office_address.cityString. Required
office_address.stateString. Optional
office_address.country_idString. Required. ID to be taken from Country List. Refer API
office_address.zipcodeString. Optional
billing_addressObject. Optional. Keys are similar to office_address. If omitted, office_address Object is replicated here.
timezone_idString. Required. ID to be taken from Timezone List. Refer API

Response Example:

{
  "result": 1,
  "msg": "$customer_name has been updated",
  "customer": {
    "customer_id": "String",
    "customer_name": "String"
  }
}

Response Explanation (Only for important Object and Keys) :

Object/KeyDescription
resultNumber. 1=Success
msgA Text Message explaining the successful transaction
customerObject. It contains key information of the new customer
customer.customer_idString. Unique ID of the Customer
customer.customer_nameString. Name of the Customer

Error Codes

Error CodeDescription
1301Customer name is required
1302Customer name must be a string
1306Customer legal name must be a string
1307Customer type is required ( P:Partner, R:Reseller, T: Top)
1308The Selected customer type is invalid
1312Boolean: True for Individual and false for corporate registrations. Default: false
1322Contact Name must be a String
1331Contact email is Required
1332Contact email must not be greater than 100 characters
1333Contact email must always be unique, a previous contact mail cannot be used again
1334Contact email must be a string
1341Office address object is Required
1342Office address 1 is required
1343Office address 1 must be a string
1344Office address 2 is optional. Must be a string
13451345 Office address 3 is optional. Must be a string
1353Office address city is Required
1354Office address city must be a string
1355Office address country ID is required, we can select country Id from country list
1356Office address state must be a string
1371Billing Address 1 must be a string
1372Billing Address 2 must be a string
1373Billing Address 3 must be a string
1380Billing Address city must be string
1381Billing Address state must be a string
1391Selected status is invalid
1404Subscription ID is required
1405Subscription ID must be a string
1408Access Mail in boolean (True or False)