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 haveapplication/json
. Authorization
: To have Token Access Information
URL Placeholder Explanation:
Placeholder | Description |
CUSTOMER_ID | This 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/Key | Description |
customer | Object. This Object carries information of the Customer |
customer.customer_code | String. Enum: T, P, R, A |
customer.customer_type_ex | String. Customer Code explained. T=Tenant/Entity, P=Customer, R=Reseller, A=Affiliate |
customer.status | String. Enum: A, S, C, U |
customer.status_ex | String. Status Code explained. A=Active, S=Suspended, C=Closed, U=Unverified |
customer.office_address | Object. This Object carries Offie Address of the Customer |
customer.billing_address | Object. 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 haveapplication/json
. Authorization
: To have Token Access Information
URL Query String Variable Explanation:
Variable | Description |
page | Number. Optional. Default 1. Data return requested for the Page |
page_num | Number. Optional. Default 10, Total Records to include in a Page |
from_join_dt | Date. Optional. Format: YYYY-MM-DD. Join Start Date Filter |
to_join_dt | Date. Optional. Format: YYYY-MM-DD. Join End Date Filter |
search_by | String. 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_string | String. Required with search_by |
order_by | String. Optional. Database field names. Multiple may be comma-separated |
order_qualify | String. 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/Key | Description |
search | Object. Contains all filter and sort options used to get the result |
customer s | Array of Objects. Each object carries information of a Customer |
customers[n].customer_code | String. Enum: T, P, R, A |
customers[n].customer_type_ex | String.Customer Code explained. T=Tenant/Entity, P=Customer, R=Reseller, A=Affiliate |
customers[n].status | String.Enum: A, S, C, U |
customers[n].status_ex | String.Status Code explained. A=Active, S=Suspended, C=Closed, U=Unverified |
customers[n].office_address | Object. This Object carries Offie Address of the Customer |
customers[n].billing_address | Object. 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 haveapplication/json
. Authorization
: To have Token Access Information
JSON Payload Explanation:
Object / Keys | Description |
customer_name | String. Required. Customer Name |
customer_legal_name | String. Required. Legal Entity name |
customer_code | String. Optional. Code, ID or Reference from External Information System |
individual | Boolean. Optional. Default: false. true for Individual; and false for corporate registrations |
contact_first_name | String. Required. Contact person first name |
contact_last_name | String. Optional. Contact person last name |
contact_email | String. Required. Contact person email address |
office_address | Object. Required. Object Keys are self explanatory |
office_address.address_1 | String. Required |
office_address.address_2 | String. Optional |
office_address.address_3 | String. Optional |
office_address.city | String. Required |
office_address.state | String. Optional |
office_address.country_id | String. Required. ID to be taken from Country List. Refer API |
office_address.zipcode | String. Optional |
billing_address | Object. 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/Key | Description |
result | Number. 1=Success |
msg | A Text Message explaining the successful transaction |
customer | Object. It contains key information of the new customer |
customer.customer_id | String. Unique ID of the Customer |
customer.customer_name | String. Name of the Customer |
portal_access | Object. Portal Access Information |
portal_access .url | String. Portal URL |
portal_access.username | String. Portal Login Credential: Username |
portal_access.password | String. 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 haveapplication/json
. Authorization
: To have Token Access Information
JSON Payload Explanation:
Object / Keys | Description |
customer_name | String. Required. Customer Name |
customer_legal_name | String. Required. Legal Entity name |
customer_code | String. Optional. Code, ID or Reference from External Information System |
individual | Boolean. Optional. Default: false. true for Individual; and false for corporate registrations |
contact_first_name | String. Required. Contact person first name |
contact_last_name | String. Optional. Contact person last name |
contact_email | String. Required. Contact person email address |
office_address | Object. Required. Object Keys are self explanatory |
office_address.address_1 | String. Required |
office_address.address_2 | String. Optional |
office_address.address_3 | String. Optional |
office_address.city | String. Required |
office_address.state | String. Optional |
office_address.country_id | String. Required. ID to be taken from Country List. Refer API |
office_address.zipcode | String. Optional |
billing_address | Object. Optional. Keys are similar to office_address . If omitted, office_address Object is replicated here. |
timezone_id | String. 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/Key | Description |
result | Number. 1=Success |
msg | A Text Message explaining the successful transaction |
customer | Object. It contains key information of the new customer |
customer.customer_id | String. Unique ID of the Customer |
customer.customer_name | String. Name of the Customer |
Error Codes
Error Code | Description |
---|---|
1301 | Customer name is required |
1302 | Customer name must be a string |
1306 | Customer legal name must be a string |
1307 | Customer type is required ( P:Partner, R:Reseller, T: Top) |
1308 | The Selected customer type is invalid |
1312 | Boolean: True for Individual and false for corporate registrations. Default: false |
1322 | Contact Name must be a String |
1331 | Contact email is Required |
1332 | Contact email must not be greater than 100 characters |
1333 | Contact email must always be unique, a previous contact mail cannot be used again |
1334 | Contact email must be a string |
1341 | Office address object is Required |
1342 | Office address 1 is required |
1343 | Office address 1 must be a string |
1344 | Office address 2 is optional. Must be a string |
1345 | 1345 Office address 3 is optional. Must be a string |
1353 | Office address city is Required |
1354 | Office address city must be a string |
1355 | Office address country ID is required, we can select country Id from country list |
1356 | Office address state must be a string |
1371 | Billing Address 1 must be a string |
1372 | Billing Address 2 must be a string |
1373 | Billing Address 3 must be a string |
1380 | Billing Address city must be string |
1381 | Billing Address state must be a string |
1391 | Selected status is invalid |
1404 | Subscription ID is required |
1405 | Subscription ID must be a string |
1408 | Access Mail in boolean (True or False) |