As another example, the User State Change API lets the
users change their state. State changes could be any one
as shown in Table 10-9. Say that you use the following
information with this API:
Finesse server FQDN: http://hq-uccx01.abc.inc
Agent name: Anthony Phyllis
Agent ID: user001
Agent password: cisco1234
The API changes the state to READY.
Example 10-10 shows a simple call using Python
requests. The API call for user login uses the PUT
request along with an XML body that sets the state to
READY.
Example 10-10 Python Request for a Finesse User
State Change
Click here to view code image
""" Finesse - User State Change"""
import requests
URL = "http://hq-
uccx.abc.inc:8082/finesse/api/User/Agent001"
PAYLOAD = (
"<User>" +
" <state>READY</state>" +
"</User>"
)
HEADERS = {
'authorization': "Basic
QWdlbnQwMDE6Y2lzY29wc2R0",
'content-type': "application/xml",
}
RESPONSE = requests.request("PUT", URL,
data=PAYLOAD, headers=HEADERS)
print(RESPONSE.text)
print(RESPONSE.status_code)
Finesse Team APIs