Created
April 2, 2014 13:45
-
-
Save sarsena/9934449 to your computer and use it in GitHub Desktop.
Example: Incontact API Gem and the RealTime API getting list of agent states
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'incontact_api' | |
require 'awesome_print' | |
ENV['UCN_URL'] = 'https://api.incontact.com' | |
ENV['UCN_KEY'] = '' | |
ENV['GRANT_TYPE'] = 'password' | |
ENV['USERNAME'] = '' | |
ENV['PASSWORD'] = '' | |
ENV['SCOPE'] = 'Admin Chat RealTime' | |
# Returns a list of all agents and their states | |
response = InContactApi::Connection.base.get "/inContactAPI/services/v2.0/agents/states" | |
p response.status | |
agents = JSON.parse(response.body) | |
ap agents |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment