DevNet Associate DEVASC 200-901 Official Certification Guide by Adrian Iliesiu (z-lib.org)

(andrew) #1

A full list of all User state change APIs with details can be
found at
https://developer.cisco.com/docs/finesse/#!userchange-
agent-state/userchange-agent-state.


For example, the User—Sign in to Finesse API forces you
to sign-in. 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

Example 10-9 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 LOGIN.


Example 10-9 Python Request: Finesse User Login

Click here to view code image


""" Finesse - User Login"""
import requests
URL = "http://hq-
uccx.abc.inc:8082/finesse/api/User/Agent001"
PAYLOAD = (
"<User>" +
" <state>LOGIN</state>" +
" <extension>6001</extension>" +
"</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)
Free download pdf