What is an API anyway?
- API stands for Application Programming Interface. It is a mechanism that allows two or more different, unrelated applications to “talk” to each other by sharing data.
- The CommunityWFM API belongs to the category of APIs known as “RESTful”.
- A RESTful API allows two systems to share data via an accessible web service, thus preventing the need for both systems to be directly connected. This allows for secure and easy connectivity between any combination of premise-based and cloud-based systems as web services are common and present in both environments.
What does an API look like?
A “Web Service” is simply a URL that resides on a system’s web application server and is accessible via regular internet, or a secure connection method, such as a VPN. In the case of CommunityWFM, this web service is an included part of the environment’s IIS server.
How does the API work?
First, the interface authenticates with the CommunityWFM API Web Service with a secure username/password combination to prevent unauthorized access to the CommunityWFM systems.
Use of the API is via a combination of pushing data into CommunityWFM and pulling data out of Community WFM.
- “GET” = Pulling
- “POST” = Pushing
The syntax for both “GET” and “POST” commands might be specific to the data in question and is fully described in the CommunityWFM API documentation.
"GET" Examples
If I want to retrieve a list of agents who are currently logged on via CommunityWFM, I would send the following “GET” command to the CommunityWFM API Web Service:
”GET api/AgentLogonReport?sortOption={sortOption}&showLoggedOnOnly={showLoggedOnOnly}&nameFilter={nameFilter}&userId={userId}”
If I want to retrieve summary information about the shrinkage factored into a forecast, I would send the following “GET” command:
“GET api/ForecastShrinkageSummary?forecastId={forecastId}&revisionNumber={revisionNumber}”
"POST" Examples
If I want to change the Activity (work) assignments for a specific agent in CommunityWFM based on an external data source, I would use the following POST command with the relevant information:
“POST api/ActivityAgentAssignment” otransactionFlagId – insert/update/delete/etc. oagentId – Agent being modified. oassignedActivities – Activities being modified for said agent. oresponsibleAgentId – System user who is initiating/authorizing the change.
If I want to insert a scheduled event into an agent’s schedule via an external source, I would use the following POST command with certain parameters, such as:
“POST api/ScheduleEvent” oeventId – What is the event being added/modified/deleted? oagentId – Which agent is affected? oduration – How long the event will last? oeventDate – On which date will the event change occur?
Real world use cases for the CommunityWFM API
- The CommunityWFM Mobile App (iOS, Android)
- Synchronizing PTO balances with HR Systems
- Workday
- ADP
- Synchronizing working/scheduled hours with Payroll/Time-Card systems, such as Kronos.
- Feeding CommunityWFM-specific data into a data-mart for custom reporting systems.