Chatwhizz External API

BaseUrl: /
Token key in Request header: access_token
Access Token API
Request TypeGET
Request URLbaseURL + admin/access-token
Required Fields :
emailorganisation's email
passwordorganisation's password
organisation_domainorganisation's sub domain name
addon_unique_nameunique name of addon

This api does not require access_token in header

Expected Output :
{
     "status": 1,
     "data": {
          "access_token": access_token using for external api,
          "refresh_token": refresh_token using for regenerate token,
          "expire_in": how long the access_token is valid (In sec),
          "organisation_domain": sub domain name of organisation
      }
}
Validate Token API
Request TypePOST
Request URLbaseURL + admin/access-token/validate
Required Fields :
access_tokenaccess token of a addon
refresh_tokenrefresh token of a addon
addon_unique_nameunique name of addon

This api does not require access_token in header

Expected Output :
{
     "status": 1,
     "data": {
          "access_token": access_token using for external api,
          "refresh_token": refresh_token using for regenerate token,
          "expire_in": how long the access_token is valid (In sec),
          "organisation_domain": Sub domain name of organisation
      }
}
Regenerate Token API
Request TypePOST
Request URLbaseURL + admin/access-token/regenerate
Required Fields :
access_tokenaccess token of a addon
refresh_tokenrefresh token of a addon

This api does not require access_token in header

Expected Output :
{
     "status": 1,
     "data": {
          "access_token": new access_token when token is expired,
          "refresh_token": new refresh_token when token is expired,
          "expire_in": how long the access_token is valid (In sec),
          "organisation_domain": sub domain name of organisation
      }
}
Create Operator API
Request TypePOST
Request URLbaseUrl + admin/operator/create
Required Fields :
emailemail of operator or user
Optional fields :
first_namefirst name of operator // This field is used when you register a new mail Id for operator or user
last_namelast name of operator
Expected Output :
{
     "status": 1,
     "data": {
          "id": id of operator // Used to get and update operator details
          "name": name of operator
          "email": email of operator
          "addon_unique_name": addon unique name at which operator create
      }
}
Get Operator Info API
Request TypeGET
Request URLbaseUrl + admin/operator/operatorId
Expected Output:
{
     "status": 1,
     "data": {
          "_id": id of operator 
          "name": name of operator
          "email": email of operator
          "status": status of operator // 0 => offline 1=> online 3=> busy 2=> away
          "operator": true => operator, false => not a operator 
      }
} 
Update Operator API (used to update the status of operator at perticuler addon)
Request TypePUT
Request URLbaseUrl + admin/operator/update/operatorId
Required Fields :
Updated Fields (This field is mandatory for update) :
statusaccepted value 0 or 1 // (operator 1=> active or 0=> inactive only for the perticuler addon)
Expected Output:
{
      "status": 1,
      "data": 'Status Changes Successfully'
}
Create Domain API
Request TypePOST
Request URLbaseUrl + admin/domain/create
Required Fields :
domain_namename of domain // without http:// or https://
emailemail for domain register
Expected Output:
{
     "status": 1,
     "data": {
          "name": name domain
          "email": email of domain
          "status": status of domain // true => active or false => inactive
          "addon_unique_name": addon unique name at which domain create
          "link": use this code at merchant website //this link is only provided for seller_buyer_chat_System
      }
}
Get Domain Info API
Request TypeGET
Request URLbaseUrl + admin/domain/domain_name
Expected Output:
{
     "status": 1,
     "data": {
          "name": name of domain
          "email": email of domain
          "status": status of domain // true => active false=>  inactive
      }
} 
Update Domain API (used to update the status, name, email of domain)
Request TypePUT
Request URLbaseUrl + admin/domain/update/domain_name
Required Fields :
updated Fields (minimum one field is mandatory for update) :
namename of domain // which you want to update
statusstatus of domain // true => active, false => inactive
emailemail for domain // which you want to update
Expected Output:
{
      "status": 1,
      "data": {
          "name": domain_name // updated value
          "status": status of domain // updated value
          "email": email of domain  // updated value
      }
}
Assign Operator In Domain At Perticuler Addon
Request TypePOST
Request URLbaseUrl + admin/operator/assign
Required Fields :
domain_namename of domain // name of domain at which create operator
operator_idid of operator // operator's id that you want to assign at domain
Optional Fields :
unique_idunique_id of seller product page // This field is used only for seller_buyer addon
is_adminmake operator as a admin // true => active, false => inactive
Expected Output :
{
     "status": 1,
     "data": {
          "operators": {
              "name": name of operator
              "email": email of operator
              "userId": id of operator
              "unique_id": unique_id of seller buyer product page // only for seller buyer addon
              "is_admin": make operator as a admin or not // true => active, false => inactive
          }
      }
}
Update Assigned Operator (update operator's online_status, is_admin, status and unique_id)
Request TypePUT
Request URLbaseUrl + admin/operator/assign/operatorId
Required Fields :
domain_namename of domain
Updated Fields (minimum one field is mandatory for update) :
unique_idunique_id for which you want to update // This is used only for seller buyer
is_admintrue or false // which you want to update
online_statustrue or false // operator visible online or offline
statustrue or false // operator getting message or not and this field is only for seller buyer
Expected Output :
{
     "status": 1,
     "data": {
          "addon_unique_name": unique name of addon
          "domain_name": domain name of addon
          "operators": {
              "online_status": visibility of operator online or offline
              "unique_id": unique_id of seller buyer product page // only for seller buyer addon
              "is_admin": make operator as a admin or not // true => active, false => inactive
              "status": true => operator getting message, false => operator didn't getting the message
          }
      }
}