Custom Import of Adherence Data Using API
Purpose of this guide: This page describes the API of the WFM application, which can be used to upload adherence data.
Audience: The network admin or technical employee with knowledge of how to use curl requests or dedicated tools to send HTTP requests to the API.
Previous steps: There are no previous steps.
When: When there is a need to upload adherence data from ACD systems into the WFM application.
Next steps: There are no next steps.
Overview
As an alternative to using the Eleveo Data Providers, adherence data can be imported using the provided API. This page describes the API, its endpoints, and its use case.
The API requires authentication. As a result, the upload of adherence data to WFM consists of two steps:
Requesting and getting an authentication token,
Uploading data (with the token) to the API in the following order:
Agent Event Types
Reason Codes
Agent Events (adherence history).
Prerequisites
The following prerequisites must be met before proceeding with the import:
Users need to be imported to User Management.
A Provider Client needs to be added to User Management. Follow the procedure described on the page Managing Provider Clients. Make sure to write down the Client ID and Secret values (they will be used when requesting the token).
Please note that you can use the same Provider Client as for Custom Import of Historical Data Using API.
API Endpoints
The following API endpoints exist:
Get Access Token – http://sso.<host>:<port>/auth/realms/<tenant>/protocol/openid-connect/token
Send Agent Event Types data to WFM – http://<tenant>.<host>:<port>/_rest/scheduling/adherence/event-types
Send Reason Codes data to WFM – http://<tenant>.<host>:<port>/_rest/scheduling/adherence/reason-codes
Send Push Agent Events data to WFM – http://<tenant>.<host>:<port>/_rest/scheduling/adherence/agent-events
where:
<host> is an address or a name of the server where WFM is running
<port> is a port opened on the server where WFM is running
<tenant> is the name of the realm (If not sure what the tenant name is, check the URL of the Eleveo applications:
<tenant>.myeleveo.com
).
Requesting and Getting the Token
The table below shows an example of the HTTP request, as well as the relevant header attributes and body which are needed to get an access token. The provided JSON body contains examples of configured parameters, replace them with relevant settings.
Action | HTTP Method | Endpoint | Header | Body |
---|---|---|---|---|
Get Access Token | POST | http://sso.<host>:<port>/auth/realms/<tenant>/protocol/openid-connect/token | Content-Type: application/x-www-form-urlencoded | { grant_type: client_credentials client_id: <Client ID from Client Provider in User Management> client_secret: <Secret from Client Provider in User Management>} |
Sample response:
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUI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InNlc3Npb25fc3RhdGUiOiI2NDYyNGVlNy02OWZlLTRhMTItOWNjYy1mNzVjZmJjMTFjYjkiLCJyZXNvdXJjZV9hY2Nlc3MiOnsid2ZtLWFkbWluaXN0cmF0aW9uLWFwcCI6eyJyb2xlcyI6WyJXRk1fVklFV19RVUVVRSIsIldGTV9DUkVBVEVfUVVFVUUiXX0sIndmbS1mb3JlY2FzdGluZy1hcHAiOnsicm9sZXMiOlsiV0ZNX0RFTEVURV9GT1JFQ0FTVCIsIldGTV9ISVNUT1JJQ0FMX0RBVEFfUFVTSCIsIldGTV9DUkVBVEVfRk9SRUNBU1QiLCJXRk1fVklFV19GT1JFQ0FTVCIsIldGTV9FRElUX0ZPUkVDQVNUIiwiV0ZNX0ZJTEVfVVBMT0FEIl19fSwic2NvcGUiOiJlbWFpbCBwcm9maWxlIn0.03-IhDoWsXfBCkmj1l6rv7U9XNBu_vw2zpirrEPnxPc",
"token_type": "bearer",
"not-before-policy": 0,
"session_state": "64624ee7-69fe-4a12-9ccc-f75cfbc11cb9",
"scope": "email profile"
Uploading Data to WFM
Agent Event Types
Action | HTTP Method | Endpoint | Header | Body |
---|---|---|---|---|
Agent Event Types import | POST | http://<tenant>.<host>:<port>/scheduling/adherence/event-types/?pushToken= <token_here>&lastChunk=true | Content-Type: application/json Tenant-ID: string, mandatory | application/json
CODE
|
Reason Codes
Action | HTTP Method | Endpoint | Header | Body |
---|---|---|---|---|
Reason Codes import | POST | http://<tenant>.<host>:<port>/scheduling/adherence/reason-codes/?pushToken= <token_here>&lastChunk=true | Content-Type: application/json Tenant-ID: string, mandatory | application/json
CODE
|
Agent Events (Adherence History)
For Agent Events (adherence history) import, data can be uploaded as chunked request.
When a large amount of data is sent to WFM (mainly in the initial upload or as a full upload), it is better to split one big upload action into smaller requests/chunks. Divide data into several parts to send them in separate requests. Use the following query parameters
pushToken – unique identifier of operation (UUID), can be generated using the guidelines described here
acdType – type of ACD from which data is uploaded, for example
genesis
(it can be found in the Agent Event Types request; it can be the same as sourceId - ID of the source from which events are imported)lastChunk – a flag that identifies if the chunk is the last in sequence, in such case, it should be set as 'true'
Set the parameters of the requests in the following way:
All chunks related to the same upload operation have the same
pushToken
andacdType
parameters (chunks of one upload request are identified based the pushToken query parameter).The
lastChunk
parameter equals 'true' only in the last chunk in the sequence. In other chunks, it is set to 'false'.
The import is considered as completed (and is displayed in the import history list on the Data Import screen) after the request with the lastChunk=true
parameter is sent.
Use a third party application or the curl command to send a request. Include the token obtained in the previous step.
Action | HTTP Method | Endpoint | Header | Query parameters | Body |
---|---|---|---|---|---|
Agent Events (adherence history) push | POST | http://<tenant>.<host>:<port>/scheduling/adherence/agent-events/?pushToken= <token_here>&acdType=<ACD_type>&lastChunk=<flag> | Content-Type: text/csv Tenant-ID: string, mandatory | pushToken: unique identifier of operation (UUID) for each upload acdType: type of ACD from which data is uploaded, for example lastChunk: flag that identifies if the chunk is the last in the sequence | stream (CSV) in the following format:
CODE
for example:
CODE
where:
|