Skip to main content
ContactNow: Using priority API Database.php end point for agent queue assignment
8x8 Support

ContactNow: Using priority API Database.php end point for agent queue assignment

API priority method is used to create, read and update agent queue assignment, from outside the standard ContactNow agent or admin interface.

To create access tokens for the ContactNow API, you will need to create a case with 8x8 Technical Support to obtain an API username and key. Once you have the username and key, you can use the instructions on the following link to create a token for using the API functionality.  ContactNow API Access.

Note: 8x8 does not provide programming support for the ContactNow API. However, further API reference material is linked in the Documentation section at the bottom of this article.

Access the ContactNow API URL

To access any ContactNow API interface, requests need to have an access token. The token will authorize requests for a particular account for a fixed period of time. By default, these requests are restricted to the internet address that requests the token.

The API url to manage these records is

https://api-106.dxi.eu/database.php?token=[Token]&method=priority&action=[Action]&format=[Format]&raw=1

The priority API has a number of available functions. The request arguments should be passed as HTTP Post or Get variables. The payload/response from the API can be formatted in either json or xml format. The default is json but this can be modified by the format argument below:

  • Formatxml or json

The API will output a number of optional values depending on the request made.

  • Success: This shows whether the request succeeded. It will contain a true or false value for json or a 1 or 0  for xml.
  • Account ID: This shows the authenticated account that ran the API call.
  • Total: Number of records affected.
  • Bad: Number of records that failed.
  • Key: the unique ID that is returned when creating a new record.
  • Error: If the request failed, this field will contain a description of the fault.
  • Example of JSON Response:
{"success":true,"account_id":"10278","total":1,"bad":0,"key":0}

Example of XML Response:

<result>
    <success>1</success> 
    <account_id>1234</account_id> 
    <total>1</total>
    <bad>0</bad> 
    <key>0</key>
</result>

To assigning an agent to a queue using database.php endpoint

This will create a new entry in the database for the agent queue assignment and return its success state and a unique key or any errors in the request. If the record already exists it will NOT add a new record and will return success true/1 and total = 0 in the response. 

  • HTTP Request: POST
  • Method: priority
  • Action: create
  • Arguments: raw, format
  • Payload: agentid (Required), qid (Required), level (Required)

POST API call with json: 

database.php?token=[Token]&format=[Format]&method=priority&action=create&raw=1

json Pay Load:

[{"agentid":"1234","qid":"1234","level":"100"}]

The Response:

{"success":true,"account_id":"10278","total":1,"bad":0,"key":550423}

xml Pay Load:

<?xml version="1.0" encoding="utf-8" ?>
<dxi>
    <priority>
        <agentid>1234</agentid>
        <qid>1234</qid>
        <level>100</level>
    </priority>
</dxi>

The Response:

<result>
    <success>1</success>
    <account_id>10278</account_id>
    <total>1</total>
    <bad>0</bad>
    <key>550423</key>

Listing agent queue priorities using database.php endpoint 

Read the data/records of a dataset.

  • HTTP Request: GET
  • Method: priority
  • Action: read
  • Arguments: agent (optional: agent_id), qid (optional)

Example:

https://api-106.dxi.eu/database.php?token=[Token]&format=[Format]&method=priority&action=read

json Response:

{"success":true,
"total":1,
"list":[
    {"agentid":"1234",
    "qid":"1007",
    "level":"0"}
]}

xml Response:

<result>
    <success>1</success>
    <total>2</total>
    <list>
        <priority>
            <agentid>1234</agentid>
            <qid>1007</qid>
            <level>0</level>
        </priority>
        <priority>
            <agentid>1234</agentid>
            <qid>1234</qid>
            <level>100</level>
        </priority>
    </list>
</result>

Update agent queue assignment using database.php endpoint

This will update an existing agent queue assignment and return its success state or any errors in the request. 

  • HTTP Request: POST
  • Method: priority
  • Action: update
  • Arguments: raw, format
  • Payload: agentid (Required), qid (Required), level (Required)

POST API call with json: 

database.php?token=[Token]&format=[Format]&method=priority&action=update&raw=1

json Pay Load:

[{"agentid":"1234","qid":"1007","level":"100"}]

The Response:

{"success":true,"account_id":"10278","total":1,"bad":0,"key":0}

xml Pay Load:

<?xml version='1.0' encoding='utf-8' ?>
<dxi>
    <agentid>1234</agentid>
    <qid>1007</qid>
    <level>100</level>
</dxi>

The Response:

<result>
    <success>1</success>
    <account_id>10278</account_id>
    <total>1</total>
    <bad>0</bad>
    <key>0</key>

Documentation 

The following 8x8 ContactNow API reference material is available to the public. Each link will open a new browser tab: