GetAllEnabledUsers: Ruby example

 
require 'rest-client'
require 'json'
company_key="CompanyKey" # Enter any company key
Username="Loginname" # Enter the user name
Password="Password" # Enter the password
 
# Global service call
GlobalResponse= RestClient.post "https://global.replicon.com/DiscoveryService1.svc/GetTenantEndpointDetails", {
  :tenant=> {
    :uri=> nil,
   :slug=> nil,
    :companyKey=> company_key
  }
}.to_json, :content_type => :json, :accept => :json
 
parsed = JSON.parse(GlobalResponse.body)
Endpoint= parsed["d"]["applicationRootUrl"]
 
#Get Enabled users
GetEnabledusers=RestClient::Request.execute method: :post, url: Endpoint+company_key+"/services/UserService1.svc/GetEnabledUsers", user: company_key+"\\"+Username, password:Password
puts GetEnabledusers.body