require'oauth2'client_id=''# Provided by Kobasclient_secret=''# Provided by Kobasclient_scopes=''# Provided by Kobaskobas_company_id=''# Provided by Kobasoauth_domain='https://oauth.kobas.co.uk'# Will only change if you are using Kobas training mode.api_domain='https://api.kobas.co.uk/v3'# Will only change if you are using Kobas training mode.# Setup the clientclient=OAuth2::Client.new(client_id,client_secret,:site=>oauth_domain,:authorize_url=>'/authorize',:token_url=>'/access_token',:connection_opts=>{:headers=>{'x-kobas-company-id'=>kobas_company_id}})# Request the tokentoken=client.client_credentials.get_token({:scope=>client_scopes},:headers=>{'x-kobas-company-id'=>kobas_company_id})# Make API request using tokenresponse=token.get(api_domain + '/venue',:headers=>{'x-kobas-company-id'=>kobas_company_id})## The resultprintresponse.body
About
An example of how to connect to the Kobas API using OAuth 2.0 authentication and Ruby.