Skip to content

Instantly share code, notes, and snippets.

@azcoov
Last active December 9, 2016 00:39
Show Gist options
  • Save azcoov/7843701 to your computer and use it in GitHub Desktop.
Save azcoov/7843701 to your computer and use it in GitHub Desktop.
Example of calling the Nearby Now API with Ruby using the rest-client gem. View the API Integration page for more examples: http://servicepros.nearbynow.co/plugins/api-integration/
require 'rest-client'
#resource = 'https://api.sidebox.com/plugin/nearbyreviews'
resource = 'https://api.sidebox.com/plugin/servicearea'
html = RestClient.get resource, {
:params => {
'storefronttoken' => '{client_api_token}',
'state' => 'AZ',
'city' => 'Phoenix',
'count' => 20
}
}
puts html
require 'rest-client'
resource = 'https://api.sidebox.com/plugin/nearbyserviceareareviewcombo'
html = RestClient.get resource, {
:params => {
'storefronttoken' => '{client_api_token}',
'state' => 'AZ',
'city' => 'Phoenix',
'checkincount' => 20,
'reviewcount' => 20
}
}
puts html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment