Add Contact

This API is used to add a new contact.

  • API Route: https://api.enablex.io/ucaas/v1/contacts
  • HTTP Request: POST

Headers Explanation:

  • Content-Type: To have application/json to notify that the body content is in JSON.

Accessibility:

  • Reseller Admin 
  • EnableX Admin 
  • Customer 
  • User

Request Example (OAuth2):

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

{
  "group_ids": [
    "OBJECT_ID_OF GROUP"
  ],
  "name": "String",
  "email": "String",
  "company": "String",
  "designation": "String",
  "shared": "Boolean"
}

Raw Body JSON Payload Explanation:

Object/KeyData TypeRequiredDescription
group_idsArrayOptionalArray of Group-Ids to which the new
contact is to be linked.
nameStringRequiredFull name of the Contact.
emailStringRequiredEmail id of the contact.
Unique in the User’s Contact List.
companyStringOptional
designationStringOptional

Response Example:

{
  "result": 1,
  "msg": "$name has been added to Contact List",
  "contact": {
    "contact_id": "String",
    "name": "String"
  }
}

Edit Contact

This API is used to update Contact’s Profile.

  • API Route: https://api.enablex.io/ucaas/v1/contacts/{{$CONTACT_ID}}
  • HTTP Request: PATCH

Headers Explanation:

  • Content-Type: To have application/json to notify that the body content is in JSON.

Accessibility:

  • Reseller Admin 
  • EnableX Admin 
  • Customer 
  • User

Request Example (OAuth2):

PATCH https://api.enablex.io/ucaas/v1/contacts/{{$CONTACT_ID}}
Content-Type: application/json
Authorization: Token ACCESS_TOTKEN

{
  "name": "String",
  "email": "String",
  "company": "String",
  "designation": "String",
  "shared": "Boolean"
}

Raw Body JSON Payload Explanation:

All data fields are optional while updating. Use only those fields which you look to update.

Object/KeyData TypeRequiredDescription
nameStringOptionalFull name of the Contact.
emailStringOptionalEmail id of the contact.
Unique in the User’s Contact List.
companyStringOptional
designationStringOptional

Response Example:

{
  "result": 1,
  "msg": "Information for $name has been updated",
  "contact": {
    "contact_id": "String",
    "name": "Sting"
  }
}

Get Contact Information

This API is used to get Information of a given Contact ID

  • API Route: https://api.enablex.io/ucaas/v1//contacts/{{$CONTACT_ID}}
  • HTTP Request: GET

Headers Explanation:

  • Content-Type: To have application/json to notify that the body content is in JSON.

Accessibility:

  • Reseller Admin 
  • EnableX Admin 
  • Customer 
  • User

Response Example:

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

{
  "result": 1,
  "contact": {
    "contact_id": "String",
    "name": "String",
    "email": "String",
    "company": "String",
    "designation": "String",
    "created_at": "Date",
    "updated_at": "Date"
  }
}

Get Contact Listing

This API is used to search or get listing of all the Contacts.

  • API Route:
    • https://api.enablex.io/ucaas/v1/contacts
    • https://api.enablex.io/ucaas/v1/contacts?page={{$PAGE_NUM}}
  • HTTP Request: GET

Headers Explanation:

  • Content-Type: To have application/json to notify that the body content is in JSON.

Accessibility:

  • Reseller Admin 
  • EnableX Admin 
  • Customer 
  • User

URL Placeholder Explanation:

Object/KeyData TypeRequiredDescription
pageNumberOptionalData return requested for the Page. Default 1.
page_lengthNumberOptionalTotal Records to include in a page. Default 10.
search_byStringOptionalRequired if “search_string” is used.
Use any of the enumerated values:
o name: On name field
o email: On email field
o company: On company field
o designation: On designation field
search_stringStringOptionalRequired with search_by.
order_byStringOptionalDatabase field names.
order_qualifyStringOptionalDefault “asc”. Enumerated values: asc, desc.

Request Example (OAuth2):

GET https://api.enablex.io/ucaas/v1/contacts?page={{$PAGE_NUM}}
Content-Type: application/json
Authorization: Token ACCESS_TOTKEN

Response Example:

{
  "result": 1,
  "search": {
    "page": "Number",
    "page_length": "Number",
    "search_by": "String",
    "search_string": "String",
    "order_by": "String",
    "order_qualify": "String"
  },
  "contacts": [
    {
      "contact_id": "String",
      "name": "String",
      "email": "String",
      "company": "String",
      "designation": "String",
      "created_at": "Date",
      "updated_at": "Date"
    }
  ]
}

Delete Contact

This API is used to delete contact of a given Contact ID.

  • API Route: https://api.enablex.io/ucaas/v1/contact/{{$CONTACT_ID}}
  • HTTP Request: DELETE

Headers Explanation:

  • Content-Type: To have application/json to notify that the body content is in JSON.

Accessibility:

  • Reseller Admin 
  • EnableX Admin 
  • Customer 
  • User

Request Example (OAuth2):

DELETE https://api.enablex.io/ucaas/v1/contacts/{{$CONTACT_ID}}
Content-Type: application/json
Authorization: Token ACCESS_TOTKEN

Response Example:

{
  "result": 1,
  "msg": "$name has been deleted from Contact List",
  "contact": {
    "contact_id": "String",
    "name": "String"
  }
}

Add Contact Group

This API is used to add a new contact group.

  • API Route: https://api.enablex.io/ucaas/v1/contact-groups
  • HTTP Request: POST

Headers Explanation:

  • Content-Type: To have application/json to notify that the body content is in JSON.

Accessibility:

  • Reseller Admin 
  • EnableX Admin 
  • Customer 
  • User

Request Example (OAuth2):

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

{
  "group_name": "String"
}

Raw Body JSON Payload Explanation:

Object/KeyData TypeRequiredDescription
group_nameStringRequiredGroup name.

Response Example:

{
  "result": 1,
  "msg": "Group $group_name has been added",
  "group": {
    "group_id": "String",
    "group_name": "String"
  }
}

Edit Contact Group

This API is used to update Contact Group Information.

  • API Route: https://api.enablex.io/ucaas/v1/contact-groups/{{$GROUP_ID}}
  • HTTP Request: PATCH

Headers Explanation:

  • Content-Type: To have application/json to notify that the body content is in JSON.

Accessibility:

  • Reseller Admin 
  • EnableX Admin 
  • Customer 
  • User

Request Example:

{
  "group_name": "String"
}

Raw Body JSON Payload Explanation:

Object/KeyData TypeRequiredDescription
group_nameStringRequiredGroup name.

Response Example:

{
  "result": 1,
  "msg": "Group $group_name has been updated",
  "contact": {
    "group_id": "String",
    "group_name": "Sting",
    "created_at": "Date",
    "updated_at": "Date"
  }
}

Get Contact Group Information

This API is used to get information about a given Group ID. 

  • API Route: https://api.enablex.io/ucaas/v1/contact-groups/{{$GROUP_ID}}
  • HTTP Request: GET

Headers Explanation:

  • Content-Type: To have application/json to notify that the body content is in JSON.

Accessibility:

  • Reseller Admin 
  • EnableX Admin 
  • Customer 
  • User

Response Example:

{
  "result": 1,
  "group": {
    "group_id": "String",
    "group_name": "String",
    "contacts": [
      {
        "contact_id": "String",
        "name": "String",
        "added_at": "Date"
      }
    ]
  }
}

Get Contact Group Listing

This API is used to search or get listing of all Contact Groups.

  • API Route:
    • https://api.enablex.io/ucaas/v1/contact-groups
    • https://api.enablex.io/ucaas/v1/contact-groups?page={{$PAGE_NUM}}
  • HTTP Request: GET

Headers Explanation:

  • Content-Type: To have application/json to notify that the body content is in JSON.

Accessibility:

  • Reseller Admin 
  • EnableX Admin 
  • Customer 
  • User

Raw Body JSON Payload Explanation:

Object/KeyData TypeRequiredDescription
pageNumberOptionalData return requested for the Page. Default 1.
page_lengthNumberOptionalTotal Records to include in a page. Default 10.
search_byStringOptionalRequired if “search_string” is used.
Use any of the enumerated values:
o group_name: On name field
search_stringStringOptionalRequired with search_by.
order_byStringOptionalDatabase field names.
order_qualifyStringOptionalDefault “asc”. Enumerated values: asc, desc.

Response Example:

{
  "result": 1,
  "search": {
    "page": "Number",
    "page_length": "Number",
    "search_by": "String",
    "search_string": "String",
    "order_by": "String",
    "order_qualify": "String"
  },
  "groups": [
    {
      "group_id": "String",
      "group_name": "String",
      "created_at": "Date",
      "updated_at": "Date"
    }
  ]
}

Delete Contact Group

This API is used to delete a given contact Group.

  • API Route: https://api.enablex.io/ucaas/v1/contact-groups/{{$GROUP_ID}}
  • HTTP Request: DELETE

Headers Explanation:

  • Content-Type: To have application/json to notify that the body content is in JSON.

Accessibility:

  • Reseller Admin 
  • EnableX Admin 
  • Customer 
  • User

Response Example:

{
  "result": 1,
  "msg": "Group $name has been deleted",
  "group": {
    "group_id": "String",
    "group_name": "String"
  }
}

Add Contact to a Group

This API is used to add new contact(s) to a group.

  • API Route: https://api.enablex.io/ucaas/v1/contact-groups/{{$GROUP_ID}}
  • HTTP Request: PATCH

Headers Explanation:

  • Content-Type: To have application/json to notify that the body content is in JSON.
  • X-License: add-contact

Accessibility:

  • Reseller Admin 
  • EnableX Admin 
  • Customer 
  • User

Request Example:

{
  "contact_ids": [
    "String"
  ]
}

Raw Body JSON Payload Explanation:

Object/KeyData TypeRequiredDescription
contact_idsObject IDsRequiredArray of Contact IDs to be added to a group

Response Example:

{
  "result": 1,
  "msg": "#Total Contact(s) are added to the Group $group_name",
  "group": {
    "group_id": "String",
    "group_name": "String",
    "contacts": [
      {
        "contact_id": "String",
        "name": "String",
        "added_at": "Date"
      }
    ]
  }
}

Delete Contact from a Contact Group

This API is used to delete contact(s) from a Contact Group.

  • API Route: https://api.enablex.io/ucaas/v1/contact-groups/{{$GROUP_ID}}
  • HTTP Request: PATCH

Headers Explanation:

  • Content-Type: To have application/json to notify that the body content is in JSON.
  • X-License: delete-contact

Accessibility:

  • Reseller Admin 
  • EnableX Admin 
  • Customer 
  • User

Request Example:

{
  "contact_ids": [
    "String"
  ]
}

Raw Body JSON Payload Explanation:

Object/KeyData TypeRequiredDescription
contact_idsObject IDsRequiredArray of Contact IDs to be deleted from the group

Response Example:

{
  "result": 1,
  "msg": "#Total Contact(s) are deleted to the Group $group_name",
  "group": {
    "group_id": "String",
    "group_name": "String",
    "contacts": [
      {
        "contact_id": "String",
        "name": "String",
        "added_at": "Date"
      }
    ]
  }
}

Error Codes

Error CodeDescription
1701Group IDs must be given in the form of an array
1702The group IDs array must have at least one item in them
1711Name field is required
1712Name must contain minimum 3 characters
1713Name must contain maximum 50 characters
1714Name must be a string
1721The email already exists, use a different email ID
1722The email must be a valid email address
1723The email must be a valid string
1724Email field is required
1725The email must have maximum 100 characters
1731Company name name must be a string
1732The company name must not be greater than 100 characters
1733The company name must be at least 5 characters
1741The designation must be a string
1742Designation must not be greater than 100 characters
1743Designation must have at least 5 characters
1802Group name must be at least 3 characters
1803Group name must be less than 100 characters
1804Group name must be a string
1805The group name has already been used please enter a different name
1810The group name must be unique and should not have been used
1811Contact IDs are required to add contact to a contact group
1812Contact IDs must be an array
1818Invalid group ID is used