The blocking API is intended for use when developing stateless clients. When using the blocking API, certain methods result in the creation of a resource. The Agent Login [AL] method is one such example.
To log in an agent one might issue a request:
http://host/softdial/scc/CG/default/AG/AL?AN=Fred&QI=FredUser
or
http://host/softdial/scc/CallGem/default/Agent/AgentLogin?AgentName=Fred&UserIdentifier=FredUser
On successful creation of agent Fred, the agent name is the resource used in the path:
http://host/softdial/scc/CG/default/AG/Fred/AA
or
http://host/softdial/scc/CallGem/default/Agent/Fred/AgentAvailable
There are 2 instance methods which allow clients to get current state and poll for state change:
Purpose |
---|
To retrieve a json document containing the current state of a resource |
Request types supported |
GET POST |
None
http://localhost/softdial/scc/CG/default/AG/Fred/GetState
HTTP Status code | Description |
---|---|
200 (OK) | Success, state of the resource returned. |
400 (Bad Request) | Badly formed request |
401 (Unauthorized) | Supplied authentication code failed authorisation |
404 (Not Found) | The resource does not exist or does not belong to this session |
The response body is a JSON document containing the state of the resource. The resource state is dependent on the type of resource. Example resource states are shown below:
{
"Name":"Fred",
"Tenant":"default",
"Campaign":"test",
"State":"Idle",
"OldState":"NotLoggedIn",
"MediaSessionGuid":"",
"RecordingSessionGuid":"",
"ContactRecordKey":"",
"MediaSessionID":"",
"Extension":"1234",
"Description":"Fred",
"Queue":"",
"Mute":"false",
"Hold":"false",
"Record":"false",
"RequiresTC":"false",
"CustomerTel":"",
"OurTel":"",
"SessionAgentSpecific":"false",
"SessionAbandonRetry":"false",
"SessionIsCallback":"false",
"SessionIsOffering":"false",
"SessionTransferState":"0",
"SessionIsPlayback":"false",
"SessionCaptureData":"",
"AgentSessionGuid":"{DD70C408-665C-4E87-A4D9-96C113361925}",
"CampaignSessionGuid":"{379CD3D8-BD4F-496C-AAB8-52E5E500C1CA}",
"StateChanged":"True"
}
{
"Name":"Fred",
"Tenant":"default",
"Campaign":"test",
"State":"Talking",
"OldState":"Waiting",
"MediaSessionGuid":"{CA78642B-26D5-4161-9077-B5A1B0AAE4C5}",
"RecordingSessionGuid":"",
"ContactRecordKey":"",
"MediaSessionID":"88888",
"Extension":"1234",
"Description":"Fred",
"Queue":"",
"Mute":"false",
"Hold":"false",
"Record":"false",
"RequiresTC":"true",
"CustomerTel":"999999",
"OurTel":"",
"SessionAgentSpecific":"false",
"SessionAbandonRetry":"false",
"SessionIsCallback":"false",
"SessionIsOffering":"false",
"SessionTransferState":"0",
"SessionIsPlayback":"false",
"SessionCaptureData":"",
"AgentSessionGuid":"{DD70C408-665C-4E87-A4D9-96C113361925}",
"CampaignSessionGuid":"{379CD3D8-BD4F-496C-AAB8-52E5E500C1CA}",
"StateChanged":"True",
"SessionData":""
}
If developing a client that needs to reflect state changes as they happen the pollstate method blocks until a timeout is reached or state changes.
Purpose |
---|
To monitor a resource for state changes |
Request types supported |
GET POST |
None
http://localhost/softdial/scc/CG/default/AG/Fred/PollState
HTTP Status code | Description |
---|---|
200 (OK) | Success, state of the resource returned. 200 (OK) is returned in all cases, and the StateChanged element is set in the JSON document to reflect whether the state has changed or the request has timed out without change |
400 (Bad Request) | Badly formed request |
401 (Unauthorized) | Supplied authentication code failed authorisation |
404 (Not Found) | The resource does not exist or does not belong to this session |
The response body is the same content as for the GetState message.
Successful response to blocking APIs relating to a resource is 200 (OK), with a JSON object representing the resource state. This is in the same form as returned by the GetState and PollState methods (see Requesting resource state above).