Skip to content

Instantly share code, notes, and snippets.

@sarsena
Created April 2, 2014 13:45
Show Gist options
  • Save sarsena/9934449 to your computer and use it in GitHub Desktop.
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
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