API Overview
The Uptivity API Server can be utilized by any program that can communicate over HTTP. Messages are sent in a simple and descriptive XML format. Commands can also be sent via http requests using the WebAPI method.
The Uptivity API Server is a standard blocking TCP server listening on port 5620. Usage is as simple as connecting to the port and sending a well-formatted XML request. You may then drop the connection, or stay connected to send another request.
Command Message Structure
Commands should end with a carriage return / line feed character (\r\n or ASCII character #13 [Hex $A]) to signal the end of data transmission.
Requests must be in a well-formed, complete XML format. The XML may contain white spaces, as they are stripped out by the server. Parameters and data types vary based on the command.
The root XML tag for the message should be the message type you are sending. Child nodes of the XML message will be attributes to the request. One common attribute that can be sent in every message is REQUESTID (this attribute is required in every request message), formatted as follows:
<REQUEST>
<TYPE>TEST</TYPE>
<REQUESTID>1</REQUESTID>
</REQUEST>
In the preceding example, the message type is "TEST". This particular message can be used as an echo test to the server to ensure the availability of the server. The REQUESTID is a number that will be repeated in the result message.
The result for this example message would look like the following:
<RESULT>
<REQUESTID>1</REQUESTID>
<REQUESTTYPE>TEST</REQUESTTYPE>
<RESULTTYPE>API_OK</RESULTTYPE>
<RESULTCODE>20</RESULTCODE>
<RESULTMSG>API_OK</RESULTMSG>
</RESULT>
The Uptivity API uses the DEVICEID to track phone states. This is true even in a free seating environment.
Many API commands require an agent identifier. To provide flexibility, the system can use a number of different fields for this purpose.
Valid values for AgentIdentifier are:
- Agent ID
- CrmUsername
- Phone
- SystemUsername
- Username
Events are different from API Responses or results. An event may be tied to an API response generated by an issued API command, or it may simply be a state change based on call activity or a Uptivity software client interacting with the API.