v2
Businesses
Following APIs are available for a Business.
- List List all the businesses associated with a user account.
- Read less Get basic details of a particular business.
- Read more Get all details of a particular business.
- Create Create a business.
- Update Update one or more attributes of a particular business.
- Archive Archive a business.
- Listings Get details of all listings of a particular business.
- Reviews Get all reviews of a particular business.
- Respond to Reviews Get all reviews of a particular business.
- Rankings Get all rankings of a particular business keywords.
- Keywords Get all keywords of a particular business.
- Add Keyword Add a new keyword to a particular business.
- Remove Keyword Remove an existing keyword for a particular business.
List
Get all businesses added by the user.
Sample Request : GET v2.synup.com/api/v2/businesses.json
curl -X GET \
'https://v2.synup.com/api/v2/businesses.json?auth_token=<YOUR AUTH_TOKEN>&user_email=<YOUR EMAIL>'
require 'uri'
require 'net/http'
url = URI("https://v2.synup.com/api/v2/businesses.json?auth_token=<YOUR AUTH_TOKEN>&user_email=<YOUR EMAIL>")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
import requests
url = "https://v2.synup.com/api/v2/businesses.json"
querystring = {"auth_token":"<YOUR AUTH_TOKEN>","user_email":"<YOUR EMAIL>"}
response = requests.request("GET", url, params=querystring)
print(response.text)
var request = require("request");
var options = { method: 'GET',
url: 'https://v2.synup.com/api/v2/businesses.json',
qs: { auth_token: '<YOUR AUTH_TOKEN>', user_email: '<YOUR EMAIL>' } };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
<?php
$request = new HttpRequest();
$request->setUrl('https://v2.synup.com/api/v2/businesses.json');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData(array(
'auth_token' => '<YOUR AUTH_TOKEN>',
'user_email' => '<YOUR EMAIL>'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
Sample Response :
{
"success": true,
"result": [
{
"id": 6730,
"name": "Saravana Bhavan",
"street": "1305 South Mary Avenue",
"city": "Sunnyvale",
"state_name": "California",
"postal_code": "94087",
"phone": "408-616-7755"
},
{
"id": 6731,
"name": "Total Plumbing",
"street": "4701 Colorado Blvd",
"city": "Denver",
"state_name": "Colarado",
"postal_code": "80216",
"phone": "303-393-7271 "
}
]
}
Error Responses:
When the wrong auth_token or user_email parameters are passed in the request.
{
"success": false,
"message": "Authentication Failure"
}
Endpoint : /businesses
Type : GET
Authentication: auth_token and user_email
Name | Type | Description |
---|---|---|
success | boolean | Response status |
id | number | Unique business identifier |
name | string | Name of business |
street | string | Street address of business |
city | string | City of business |
state_name | string | Full state of business |
postal_code | string | Postal code of business |
phone | string | Phone of business |
Read(Less)
Get basic details of a particular business.
Sample Request : GET v2.synup.com/api/v2/businesses/6730.json
curl -X GET \
'https://v2.synup.com/api/v2/businesses/6730.json?auth_token=<YOUR AUTH_TOKEN>&user_email=<YOUR EMAIL>'
<?php
$request = new HttpRequest();
$request->setUrl('https://v2.synup.com/api/v2/businesses/6730.json');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData(array(
'auth_token' => '<YOUR AUTH_TOKEN>',
'user_email' => '<YOUR EMAIL>'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
import requests
url = "https://v2.synup.com/api/v2/businesses/6730.json"
querystring = {"auth_token":"<YOUR AUTH_TOKEN>","user_email":"<YOUR EMAIL>"}
response = requests.request("GET", url, params=querystring)
print(response.text)
require 'uri'
require 'net/http'
url = URI("https://v2.synup.com/api/v2/businesses/6730.json?auth_token=<YOUR AUTH_TOKEN>&user_email=<YOUR EMAIL>")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
var request = require("request");
var options = { method: 'GET',
url: 'https://v2.synup.com/api/v2/businesses/6730.json',
qs: { auth_token: '<YOUR AUTH_TOKEN>', user_email: '<YOUR EMAIL>' } };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
Sample Response :
{
"success": true,
"result": {
"id": 6730,
"name": "Saravana Bhavan",
"street": "1305 South Mary Avenue",
"city": "Sunnyvale",
"state_name": "California",
"postal_code": "94087",
"phone": "408-616-7755",
"biz_url": "http://saravanaabhavan-ca.com/",
"hide_address": false
}
}
Error Responses:
- When the wrong auth_token or user_email parameters are passed in the request.
{
"success": false,
"message": "Authentication Failure"
}
- When the wrong business id is passed in the request.
{
"success": false,
"message": "This business doesn't exist"
}
Endpoint : /businesses/<:business_id>
Type : GET
Authentication: auth_token and user_email
Name | Type | Description |
---|---|---|
business_id | number | Unique business identifier |
Name | Type | Description |
---|---|---|
success | boolean | Response status |
id | number | Unique business identifier |
name | string | Name of business |
street | string | Street address of business |
city | string | City of business |
state_name | string | Full state of business |
postal_code | string | Postal code of business |
phone | string | Phone of business |
Read(More)
Get all details of a particular business.
Sample Request : GET v2.synup.com/api/v2/businesses/6730.json?type=all
curl -X GET \
'https://v2.synup.com/api/v2/businesses/6730.json?type=all&auth_token=<YOUR AUTH_TOKEN>&user_email=<YOUR EMAIL>'
<?php
$request = new HttpRequest();
$request->setUrl('https://v2.synup.com/api/v2/businesses/6730.json');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData(array(
'type' => 'all',
'auth_token' => '<YOUR AUTH_TOKEN>',
'user_email' => '<YOUR EMAIL>'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
import requests
url = "https://v2.synup.com/api/v2/businesses/6730.json"
querystring = {"type":"all","auth_token":"<YOUR AUTH_TOKEN>","user_email":"<YOUR EMAIL>"}
response = requests.request("GET", url, params=querystring)
print(response.text)
require 'uri'
require 'net/http'
url = URI("https://v2.synup.com/api/v2/businesses/6730.json?type=all&auth_token=<YOUR AUTH_TOKEN>&user_email=<YOUR EMAIL>")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
var request = require("request");
var options = { method: 'GET',
url: 'https://v2.synup.com/api/v2/businesses/6730.json',
qs: { type: 'all', auth_token: '<YOUR AUTH_TOKEN>', user_email: '<YOUR EMAIL>' } };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
Sample Response :
{
"success": true,
"result": {
"id": 6730,
"name": "Saravana Bhavan",
"street": "1305 South Mary Avenue",
"city": "Sunnyvale",
"state_name": "California",
"postal_code": "94087",
"phone": "408-616-7755",
"latitude": "37.3508940",
"longitude": "-122.0508460",
"biz_url": "http://saravanaabhavan-ca.com/",
"owner_first_name": "Raison",
"owner_last_name": "Dsouza",
"facebook_url": null,
"twitter_url": null,
"description": "South Indian restaurant chain",
"tagline": "Traditional Indian Food",
"storecode": "SB0012",
"additional_categories": ["12", "244"],
"business_hours": [
{
"day": "Monday",
"start_time": "10:00",
"end_time": "22:00"
},
{
"day": "Tuesday",
"start_time": null,
"end_time": null
},
{
"day": "Wednesday",
"start_time": "10:00",
"end_time": "22:00"
},
{
"day": "Thursday",
"start_time": "10:00",
"end_time": "22:00"
},
{
"day": "Friday",
"start_time": "10:00",
"end_time": "22:00"
},
{
"day": "Saturday",
"start_time": "10:00",
"end_time": "22:00"
},
{
"day": "Sunday",
"start_time": "10:00",
"end_time": "22:00"
}
],
"hide_address": false
}
}
Error Responses:
- When the wrong auth_token or user_email parameters are passed in the request.
{
"success": false,
"message": "Authentication Failure"
}
- When the wrong business id is passed in the request.
{
"success": false,
"message": "This business doesn't exist"
}
Endpoint : /businesses/<:business_id>
Type : GET
Authentication: auth_token and user_email
Name | Type | Description |
---|---|---|
business_id | number | Unique business identifier |
Name | Type | Description |
---|---|---|
success | boolean | Response status |
id | number | Unique business identifier |
name | string | Name of business |
street | string | Street address of business |
city | string | City of business |
state_name | string | Full state of business |
postal_code | string | Postal code of business |
latitude | number | Phone of business |
longitude | number | Longitude |
biz_url | string | Website of business |
owner_first_name | string | First name of owner |
owner_last_name | string | Last name of owner |
facebook_url | string | Facebook url of business |
twitter_url | string | Twitter url of business |
description | string | Description of business |
tagline | string | Tagline of the business |
storecode | string | Store code of business |
business_hours | array | Working hours of business specified by day, start_time and end_time |
additional_categories | array | Additional categories of business |
Create V2
Creates a business.
Sample Request** : POST v2.synup.com/api/v2/businesses.json
curl -X POST \
'https://v2.synup.com/api/v2/businesses.json?auth_token=<YOUR AUTH_TOKEN>&user_email=<YOUR EMAIL>' \
-H 'content-type: application/json' \
-d '{
"business": {
"name": "The Nugget Spot",
"street": "230 East 14th Street",
"city": "New York",
"state_id": "3537",
"country_id": "233",
"postal_code": "20003",
"phone": "6464228846",
"biz_url": "http://www.thenuggetspot.com/",
"sub_category_id": "383",
"year_of_inc": "1994",
"description": "Inspired by an iconic childhood favorite, The Nugget Spot is dedicated by an iconic childhood favorite, The Nugget Spot is dedicated by an iconic childhood favorite, The Nugget Spot is dedicated, The Nugget Spot is dedicated",
"storecode": "NS00123",
"hide_address" : false,
"facebook_url": "https://facebook.com/thenuggetspot",
"googleplus_url": "https://plus.google.com/thenuggetspot",
"linkedin_url": "https://linkedin.com/us/thenuggetspot",
"twitter_url": "https://twitter.com/thenuggetspot",
"biz_logo_link": "http://thenuggetspot.com/images/slideshow_images/home-teaser2.jpg",
"biz_cover" : "http://thenuggetspot.com/images/slideshow_images/home-teaser1.jpg",
"location_photos_attributes": [
{ "photo": "http://thenuggetspot.com/images/slideshow_images/home-teaser4.jpg" },
{ "photo": "http://thenuggetspot.com/images/slideshow_images/home-teaser1.jpg" }
],
"videos_attributes": [
{ "link": "https://www.youtube.com/watch?v=2i_Cnfjv4Jw" },
{ "link": "https://www.youtube.com/watch?v=ABCCnfjv4Jw" }
],
"payment_methods_attributes": [
{ "name": "Visa", "is_accepted": true },
{ "name": "Master Card", "is_accepted": true }
],
"owner_email": "admin@thenuggetspot.com",
"owner_first_name": "Bryan",
"owner_last_name": "Adams",
"tagline": "Eat in or take out!",
"additional_info": "We'\''ve designed '\''The Spot'\'' to be ....",
"additional_categories": ["12", "244"],
"biz_hours": {
"days": {
"Monday": {"type": "open", "slots": [{ "start": "05:00am", "end": "05:30pm"}]},
"Tuesday": {"type": "open", "slots": [{ "start": "05:00am", "end": "05:30pm"}]},
"Wednesday": {"type": "open", "slots": [{ "start": "05:00am", "end": "05:30pm"}]},
"Thursday": {"type": "open", "slots": [{ "start": "05:00am", "end": "05:30pm"}]},
"Friday": {"type": "split", "slots": [{ "start": "05:00am", "end": "12:30pm"},{ "start": "01:00pm", "end": "05:30pm"}]},
"Saturday": {"type": "closed"},
"Sunday": {"type": "24h"}
}
}
}
}'
import requests
url = "https://v2.synup.com/api/v2/businesses.json"
querystring = {"user_email":"<YOUR EMAIL>","auth_token":"<YOUR AUTH_TOKEN>"}
payload = "{\n \"business\": {\n \"name\": \"The Nugget Spot\",\n \"street\": \"230 East 14th Street\",\n \"city\": \"New York\",\n \"state_id\": \"3537\",\n \"country_id\": \"233\",\n \"postal_code\": \"20003\",\n \"phone\": \"6464228846\",\n \"biz_url\": \"http://www.thenuggetspot.com/\",\n \"sub_category_id\": \"383\",\n \"year_of_inc\": \"1994\",\n \"description\": \"Inspired by an iconic childhood favorite, The Nugget Spot is dedicated by an iconic childhood favorite, The Nugget Spot is dedicated by an iconic childhood favorite, The Nugget Spot is dedicated, The Nugget Spot is dedicated\",\n \"storecode\": \"NS00123\",\n \"facebook_url\": \"https://facebook.com/thenuggetspot\",\n \"googleplus_url\": \"https://plus.google.com/thenuggetspot\",\n \"linkedin_url\": \"https://linkedin.com/us/thenuggetspot\",\n \"twitter_url\": \"https://twitter.com/thenuggetspot\",\n \"hide_address\": false,\n \"biz_logo_link\": \"http://thenuggetspot.com/images/slideshow_images/home-teaser2.jpg\",\n \"location_photos_attributes\": [\n { \"photo\": \"http://thenuggetspot.com/images/slideshow_images/home-teaser4.jpg\" },\n { \"photo\": \"http://thenuggetspot.com/images/slideshow_images/home-teaser1.jpg\" }\n ],\n \"videos_attributes\": [\n { \"link\": \"https://www.youtube.com/watch?v=2i_Cnfjv4Jw\" },\n { \"link\": \"https://www.youtube.com/watch?v=ABCCnfjv4Jw\" }\n ],\n \"payment_methods_attributes\": [\n { \"name\": \"Visa\", \"is_accepted\": true },\n { \"name\": \"Master Card\", \"is_accepted\": true }\n ],\n \"owner_email\": \"admin@thenuggetspot.com\",\n \"owner_first_name\": \"Bryan\",\n \"owner_last_name\": \"Adams\",\n \"tagline\": \"Eat in or take out!\",\n \"additional_info\": \"We've designed 'The Spot' to be ....\",\n \"biz_hours\": {\n \t\"days\": { \n \t\t\"Monday\": {\"type\": \"open\", \"slots\": [{ \"start\": \"05:00am\", \"end\": \"05:30pm\"}]},\n\t \"Tuesday\": {\"type\": \"open\", \"slots\": [{ \"start\": \"05:00am\", \"end\": \"05:30pm\"}]},\n\t \"Wednesday\": {\"type\": \"open\", \"slots\": [{ \"start\": \"05:00am\", \"end\": \"05:30pm\"}]},\n\t \"Thursday\": {\"type\": \"open\", \"slots\": [{ \"start\": \"05:00am\", \"end\": \"05:30pm\"}]},\n\t \"Friday\": {\"type\": \"split\", \"slots\": [{ \"start\": \"05:00am\", \"end\": \"12:30pm\"},{ \"start\": \"01:00pm\", \"end\": \"05:30pm\"}]},\n\t \"Saturday\": {\"type\": \"closed\"},\n\t \"Sunday\": {\"type\": \"24h\"}\n \t}\n }\n\n }\n}"
headers = {'content-type': 'application/json'}
response = requests.request("POST", url, data=payload, headers=headers, params=querystring)
print(response.text)
require 'uri'
require 'net/http'
url = URI("https://v2.synup.com/api/v2/businesses.json?user_email=<YOUR EMAIL>&auth_token=<YOUR AUTH_TOKEN>")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"business\": {\n \"name\": \"The Nugget Spot\",\n \"street\": \"230 East 14th Street\",\n \"city\": \"New York\",\n \"state_id\": \"3537\",\n \"country_id\": \"233\",\n \"postal_code\": \"20003\",\n \"phone\": \"6464228846\",\n \"biz_url\": \"http://www.thenuggetspot.com/\",\n \"sub_category_id\": \"383\",\n \"year_of_inc\": \"1994\",\n \"description\": \"Inspired by an iconic childhood favorite, The Nugget Spot is dedicated by an iconic childhood favorite, The Nugget Spot is dedicated by an iconic childhood favorite, The Nugget Spot is dedicated, The Nugget Spot is dedicated\",\n \"storecode\": \"NS00123\",\n \"facebook_url\": \"https://facebook.com/thenuggetspot\",\n \"googleplus_url\": \"https://plus.google.com/thenuggetspot\",\n \"linkedin_url\": \"https://linkedin.com/us/thenuggetspot\",\n \"twitter_url\": \"https://twitter.com/thenuggetspot\",\n \"hide_address\": false,\n \"biz_logo_link\": \"http://thenuggetspot.com/images/slideshow_images/home-teaser2.jpg\",\n \"location_photos_attributes\": [\n { \"photo\": \"http://thenuggetspot.com/images/slideshow_images/home-teaser4.jpg\" },\n { \"photo\": \"http://thenuggetspot.com/images/slideshow_images/home-teaser1.jpg\" }\n ],\n \"videos_attributes\": [\n { \"link\": \"https://www.youtube.com/watch?v=2i_Cnfjv4Jw\" },\n { \"link\": \"https://www.youtube.com/watch?v=ABCCnfjv4Jw\" }\n ],\n \"payment_methods_attributes\": [\n { \"name\": \"Visa\", \"is_accepted\": true },\n { \"name\": \"Master Card\", \"is_accepted\": true }\n ],\n \"owner_email\": \"admin@thenuggetspot.com\",\n \"owner_first_name\": \"Bryan\",\n \"owner_last_name\": \"Adams\",\n \"tagline\": \"Eat in or take out!\",\n \"additional_info\": \"We've designed 'The Spot' to be ....\",\n \"biz_hours\": {\n \t\"days\": { \n \t\t\"Monday\": {\"type\": \"open\", \"slots\": [{ \"start\": \"05:00am\", \"end\": \"05:30pm\"}]},\n\t \"Tuesday\": {\"type\": \"open\", \"slots\": [{ \"start\": \"05:00am\", \"end\": \"05:30pm\"}]},\n\t \"Wednesday\": {\"type\": \"open\", \"slots\": [{ \"start\": \"05:00am\", \"end\": \"05:30pm\"}]},\n\t \"Thursday\": {\"type\": \"open\", \"slots\": [{ \"start\": \"05:00am\", \"end\": \"05:30pm\"}]},\n\t \"Friday\": {\"type\": \"split\", \"slots\": [{ \"start\": \"05:00am\", \"end\": \"12:30pm\"},{ \"start\": \"01:00pm\", \"end\": \"05:30pm\"}]},\n\t \"Saturday\": {\"type\": \"closed\"},\n\t \"Sunday\": {\"type\": \"24h\"}\n \t}\n }\n\n }\n}"
response = http.request(request)
puts response.read_body
<?php
$request = new HttpRequest();
$request->setUrl('https://v2.synup.com/api/v2/businesses.json');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData(array(
'user_email' => '<YOUR EMAIL>',
'auth_token' => '<YOUR AUTH_TOKEN>'
));
$request->setHeaders(array(
'content-type' => 'application/json'
));
$request->setBody('{
"business": {
"name": "The Nugget Spot",
"street": "230 East 14th Street",
"city": "New York",
"state_id": "3537",
"country_id": "233",
"postal_code": "20003",
"phone": "6464228846",
"biz_url": "http://www.thenuggetspot.com/",
"sub_category_id": "383",
"year_of_inc": "1994",
"description": "Inspired by an iconic childhood favorite, The Nugget Spot is dedicated by an iconic childhood favorite, The Nugget Spot is dedicated by an iconic childhood favorite, The Nugget Spot is dedicated, The Nugget Spot is dedicated",
"storecode": "NS00123",
"facebook_url": "https://facebook.com/thenuggetspot",
"googleplus_url": "https://plus.google.com/thenuggetspot",
"linkedin_url": "https://linkedin.com/us/thenuggetspot",
"twitter_url": "https://twitter.com/thenuggetspot",
"hide_address" : false,
"biz_logo_link": "http://thenuggetspot.com/images/slideshow_images/home-teaser2.jpg",
"biz_cover" : "http://thenuggetspot.com/images/slideshow_images/home-teaser1.jpg",
"location_photos_attributes": [
{ "photo": "http://thenuggetspot.com/images/slideshow_images/home-teaser4.jpg" },
{ "photo": "http://thenuggetspot.com/images/slideshow_images/home-teaser1.jpg" }
],
"videos_attributes": [
{ "link": "https://www.youtube.com/watch?v=2i_Cnfjv4Jw" },
{ "link": "https://www.youtube.com/watch?v=ABCCnfjv4Jw" }
],
"payment_methods_attributes": [
{ "name": "Visa", "is_accepted": true },
{ "name": "Master Card", "is_accepted": true }
],
"owner_email": "admin@thenuggetspot.com",
"owner_first_name": "Bryan",
"owner_last_name": "Adams",
"tagline": "Eat in or take out!",
"additional_info": "We've designed 'The Spot' to be ....",
"additional_categories": ["12", "244"],
"biz_hours": {
"days": {
"Monday": {"type": "open", "slots": [{ "start": "05:00am", "end": "05:30pm"}]},
"Tuesday": {"type": "open", "slots": [{ "start": "05:00am", "end": "05:30pm"}]},
"Wednesday": {"type": "open", "slots": [{ "start": "05:00am", "end": "05:30pm"}]},
"Thursday": {"type": "open", "slots": [{ "start": "05:00am", "end": "05:30pm"}]},
"Friday": {"type": "split", "slots": [{ "start": "05:00am", "end": "12:30pm"},{ "start": "01:00pm", "end": "05:30pm"}]},
"Saturday": {"type": "closed"},
"Sunday": {"type": "24h"}
}
}
}
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
var request = require("request");
var options = { method: 'POST',
url: 'https://v2.synup.com/api/v2/businesses.json',
qs:
{ user_email: '<YOUR EMAIL>',
auth_token: '<YOUR AUTH_TOKEN>' },
headers: { 'content-type': 'application/json' },
body:
{ business:
{ name: 'The Nugget Spot',
street: '230 East 14th Street',
city: 'New York',
state_id: '3537',
country_id: '233',
postal_code: '20003',
phone: '6464228846',
biz_url: 'http://www.thenuggetspot.com/',
sub_category_id: '383',
year_of_inc: '1994',
description: 'Inspired by an iconic childhood favorite, The Nugget Spot is dedicated by an iconic childhood favorite, The Nugget Spot is dedicated by an iconic childhood favorite, The Nugget Spot is dedicated, The Nugget Spot is dedicated',
storecode: 'NS00123',
facebook_url: 'https://facebook.com/thenuggetspot',
googleplus_url: 'https://plus.google.com/thenuggetspot',
linkedin_url: 'https://linkedin.com/us/thenuggetspot',
twitter_url: 'https://twitter.com/thenuggetspot',
hide_address: false,
biz_logo_link: 'http://thenuggetspot.com/images/slideshow_images/home-teaser2.jpg',
biz_cover : 'http://thenuggetspot.com/images/slideshow_images/home-teaser1.jpg',
location_photos_attributes:
[ { photo: 'http://thenuggetspot.com/images/slideshow_images/home-teaser4.jpg' },
{ photo: 'http://thenuggetspot.com/images/slideshow_images/home-teaser1.jpg' } ],
videos_attributes:
[ { link: 'https://www.youtube.com/watch?v=2i_Cnfjv4Jw' },
{ link: 'https://www.youtube.com/watch?v=ABCCnfjv4Jw' } ],
payment_methods_attributes:
[ { name: 'Visa', is_accepted: true },
{ name: 'Master Card', is_accepted: true } ],
owner_email: 'admin@thenuggetspot.com',
owner_first_name: 'Bryan',
owner_last_name: 'Adams',
tagline: 'Eat in or take out!',
additional_info: 'We\'ve designed \'The Spot\' to be ....',
biz_hours:
{ days:
{ Monday:
{ type: 'open',
slots: [ { start: '05:00am', end: '05:30pm' } ] },
Tuesday:
{ type: 'open',
slots: [ { start: '05:00am', end: '05:30pm' } ] },
Wednesday:
{ type: 'open',
slots: [ { start: '05:00am', end: '05:30pm' } ] },
Thursday:
{ type: 'open',
slots: [ { start: '05:00am', end: '05:30pm' } ] },
Friday:
{ type: 'split',
slots:
[ { start: '05:00am', end: '12:30pm' },
{ start: '01:00pm', end: '05:30pm' } ] },
Saturday: { type: 'closed' },
Sunday: { type: '24h' } } } } },
json: true };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
Sample Response :
{
"success": true,
"result": {
"id": 6879,
"name": "The Nugget Spot",
"street": "230 East 14th Street",
"city": "New York",
"state_name": "New York",
"sub_category_name": "American Restaurants",
"postal_code": "10003",
"phone": "646-422-7346",
"biz_url": "http://www.thenuggetspot.com/",
"hide_address": false
}
}
Endpoint : /businesses
Type : POST
Authentication: auth_token and user_email
Name | Type | Description | Mandatory |
---|---|---|---|
name | string | Name of business | Yes |
street | string | Street address of business | Yes |
city | string | City of business | Yes |
state_id | number | Unique state identifier obtained from here | Yes |
country_id | number | Unique country identifier obtained from here | Yes |
postal_code | string | Postal code of business | Yes |
phone | string | Phone of business | Yes |
biz_url | string | Website of business | No |
sub_category_id | number | Unique sub category identifier obtained from here. Only primary: true Sub Category is allowed. |
Yes |
year_of_inc | string | Year of Incorporation of business | No |
description | string | Description of the business. (Min: 200 chars Max: 1024 chars) | Yes |
storecode | string | Store code of the business. | No |
location_biz_hour_attributes | array | (to be deprecated by 15th Mar. ‘18) Hours of operation of the business. Individual attributes described below. | No |
biz_hours | hash | (replaced location_biz_hour_attributes)Hours of operation of the business. Individual attributes described below. | No |
biz_logo_link | string | Url of the business logo | No |
biz_cover | string | Url of the business cover photo | No |
location_photos_attributes | array | Photo urls of the business. Individual attributes described below. | No |
video_attributes | array | Video links of the business. Individual attributes described below. | No |
payment_methods_attributes | array | Methods of payment accepted by the business. Individual attributes described below. | No |
facebook_url | string | Facebook page of the business | No |
twitter_url | string | Twitter page of the business | No |
linkedin_url | string | LinkedIn url of the business | No |
googleplus_url | string | Google Plus url of the business | No |
hide_address | boolean | The business will only be submitted only to sites where this feature is available. The list of sites for the business might change if this feature is set to true . |
No |
owner_email | string | email id of the biz owner | No |
owner_first_name | string | First name of the business owner | No |
owner_last_name | string | Last name of the business owner | No |
tagline | string | Tagline for the business. Max: 255 chars | No |
additional_info | string | Additonal info for the business. Max: 1024 chars | No |
additional_categories | array | All additional category identifier obtained from here. Max 9 additional categories allowed. | No |
Hours of Operation
Old Details (to be deprecated by 15th Mar. '18)
Old operation hours payload:
"location_biz_hours_attributes": [
{ "day": "Monday", "holiday": false, "start_time": "05:00am", "end_time": "05:30pm"},
{ "day": "Tuesday", "holiday": false, "start_time": "09:00am", "end_time": "08:00pm"},
{ "day": "Wednesday", "holiday": false, "start_time": "09:00am", "end_time": "08:00pm"},
{ "day": "Thursday", "holiday": false, "start_time": "09:00am", "end_time": "08:00pm"},
{ "day": "Friday", "holiday": false, "start_time": "09:00am", "end_time": "08:00pm"},
{ "day": "Saturday", "holiday": true},
{ "day": "Sunday", "holiday": true}
]
Name | Type | Description |
---|---|---|
day | string | Can be one among “Monday”, “Tuesday”, “Wednesday”, “Thursday”, “Friday”, “Saturday”, “Sunday” |
holiday | boolean | Indicates if the business is closed on that particular day. |
start_time | string | Opening hours of business on that particular day. Format is “hh:mmam/pm”. Example: 10:00am |
end_time | string | Closing hours of business on that particular day. Format is “hh:mmam/pm”. Example: 10:00pm |
New details
The new payload is a hash of following type:
"biz_hours": {
"days": {
"Monday": {"type": "open", "slots": [{ "start": "05:00am", "end": "05:30pm"}]},
"Tuesday": {"type": "open", "slots": [{ "start": "05:00am", "end": "05:30pm"}]},
"Wednesday": {"type": "open", "slots": [{ "start": "05:00am", "end": "05:30pm"}]},
"Thursday": {"type": "open", "slots": [{ "start": "05:00am", "end": "05:30pm"}]},
"Friday": {"type": "split", "slots": [{ "start": "05:00am", "end": "12:30pm"},{ "start": "01:00pm", "end": "05:30pm"}]},
"Saturday": {"type": "closed"},
"Sunday": {"type": "24h"}
}
}
Name | Type | Description |
---|---|---|
day | string | Can be one among “Monday”, “Tuesday”, “Wednesday”, “Thursday”, “Friday”, “Saturday”, “Sunday” |
type | string | Indicates if the type of business hours for the day. Possible values are “closed”, “split”, “24h”, “open” |
slot | hash | Eash slot represents a pair of start and end times. It is an hash having two keys “start” and “end” representing start_time and end_time of slot respectively. Maximum of two slots are allowed for each day. |
start/end | string | Opening and Closing hours of business on that particular slot of day. Format is “hh:mm am/pm” in 12 hours format or “HHMM” in 24 hours format |
slots | array | Its an array of slot(hashes) that each day comprises of. If type is “open” array should have only one slot. If type is “split” the array should have two slots. Slots aren’t required at all for the case of “closed” and “24h” |
Note: Hours of operation have to be provided for all 7 days in a week or NONE at all.
Error Responses:
When the wrong auth_token or user_email parameters are passed in the request.
{
"success": false,
"message": "Authentication Failure"
}
When the wrong state id is passed in the request.
{
"success": false,
"message": "The business was not created. State can't be blank."
}
When the wrong subcategory id is passed in the request.
{
"success": false,
"message": "The business was not created. Sub Category can't be blank."
}
When all the days in hours of operation are not passed in the request.(No error will be raised if none of the business hours are passed)
{
"success": false,
"message": "The business was not created. Operating hours should include all days of the week."
}
When the start time or end time in the hours of operation is left blank.
{
"success": false,
"message": "The business was not created. Please specify valid operating hours for each day of the week."
}
When the incorrect time format for the hours of operation is passed in the request.
{
"success": false,
"message": "The business was not created. Operating hours should be in 12 hours format and no trailing spaces. eg '09:00am'."
}
When any attribute validation fails.
{
"success": false,
"message": "The business was not created. Name is too short (minimum is 2 characters). Phone Invalid Phone number(format: 934-344-5423)"
}
Photos
Name | Type | Description |
---|---|---|
photo | string | Web url to the photo |
Video
Name | Type | Description |
---|---|---|
link | string | Web url to the video |
Payment Methods
Name | Type | Description |
---|---|---|
name | string | Type of payment method. Can be one among “Visa”, “Cash”, “Cheque”, “Master Card”, “American Express” |
is_accepted | boolean | Indicates the acceptance of the particular payment method. |
Update
Update one or more attributes of a particular business.
Sample Request : PUT v2.synup.com/api/v2/businesses/6730.json
require 'uri'
require 'net/http'
url = URI("https://v2.synup.com/api/v2/businesses/1617?user_email=%3CYOUR%20EMAIL%3E&auth_token=%3CYOUR%20AUTH_TOKEN%3E")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"business\": {\n \"name\": \"Saravanaa Bhavan\",\n \"phone\": \"408-616-5577\",\n \"biz_hours\": {\n \"days\": {\n \"Monday\": { \"type\": \"open\", \"slots\": [{\"start\": \"05:00 am\", \"end\": \"05:30 pm\"}] },\n \"Tuesday\": { \"type\": \"open\", \"slots\": [{\"start\": \"05:00 am\", \"end\": \"05:30 pm\"}] },\n \"Wednesday\": { \"type\": \"open\", \"slots\": [{\"start\": \"05:00 am\", \"end\": \"05:30 pm\"}] },\n \"Thursday\": { \"type\": \"open\", \"slots\": [{\"start\": \"05:00 am\", \"end\": \"05:30 pm\"}] },\n \"Friday\": { \"type\": \"split\", \"slots\": [{\"start\": \"05:00 am\", \"end\": \"10:30 pm\"},{\"start\": \"12:00 pm\", \"end\": \"05:30 pm\"}] },\n \"Saturday\": { \"type\": \"closed\" },\n \"Sunday\": { \"type\": \"24h\" }\n }\n }\n\n }\n}"
response = http.request(request)
puts response.read_body
import requests
url = "https://v2.synup.com/api/v2/businesses/1617"
querystring = {"user_email":"<YOUR EMAIL>","auth_token":"<YOUR AUTH_TOKEN>"}
payload = "{\n \"business\": {\n \"name\": \"Saravanaa Bhavan\",\n \"phone\": \"408-616-5577\",\n \"biz_hours\": {\n \"days\": {\n \"Monday\": { \"type\": \"open\", \"slots\": [{\"start\": \"05:00 am\", \"end\": \"05:30 pm\"}] },\n \"Tuesday\": { \"type\": \"open\", \"slots\": [{\"start\": \"05:00 am\", \"end\": \"05:30 pm\"}] },\n \"Wednesday\": { \"type\": \"open\", \"slots\": [{\"start\": \"05:00 am\", \"end\": \"05:30 pm\"}] },\n \"Thursday\": { \"type\": \"open\", \"slots\": [{\"start\": \"05:00 am\", \"end\": \"05:30 pm\"}] },\n \"Friday\": { \"type\": \"split\", \"slots\": [{\"start\": \"05:00 am\", \"end\": \"10:30 pm\"},{\"start\": \"12:00 pm\", \"end\": \"05:30 pm\"}] },\n \"Saturday\": { \"type\": \"closed\" },\n \"Sunday\": { \"type\": \"24h\" }\n }\n }\n\n }\n}"
headers = {'content-type': 'application/json'}
response = requests.request("PUT", url, data=payload, headers=headers, params=querystring)
print(response.text)
var request = require("request");
var options = { method: 'PUT',
url: 'https://v2.synup.com/api/v2/businesses/1617',
qs: { user_email: '<YOUR EMAIL>', auth_token: '<YOUR AUTH_TOKEN>' },
headers: { 'content-type': 'application/json' },
body:
{ business:
{ name: 'Saravanaa Bhavan',
phone: '408-616-5577',
biz_hours:
{ days:
{ Monday:
{ type: 'open',
slots: [ { start: '05:00 am', end: '05:30 pm' } ] },
Tuesday:
{ type: 'open',
slots: [ { start: '05:00 am', end: '05:30 pm' } ] },
Wednesday:
{ type: 'open',
slots: [ { start: '05:00 am', end: '05:30 pm' } ] },
Thursday:
{ type: 'open',
slots: [ { start: '05:00 am', end: '05:30 pm' } ] },
Friday:
{ type: 'split',
slots:
[ { start: '05:00 am', end: '10:30 pm' },
{ start: '12:00 pm', end: '05:30 pm' } ] },
Saturday: { type: 'closed' },
Sunday: { type: '24h' } } } } },
json: true };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
<?php
$request = new HttpRequest();
$request->setUrl('https://v2.synup.com/api/v2/businesses/1617');
$request->setMethod(HTTP_METH_PUT);
$request->setQueryData(array(
'user_email' => '<YOUR EMAIL>',
'auth_token' => '<YOUR AUTH_TOKEN>'
));
$request->setHeaders(array(
'content-type' => 'application/json'
));
$request->setBody('{
"business": {
"name": "Saravanaa Bhavan",
"phone": "408-616-5577",
"biz_hours": {
"days": {
"Monday": { "type": "open", "slots": [{"start": "05:00 am", "end": "05:30 pm"}] },
"Tuesday": { "type": "open", "slots": [{"start": "05:00 am", "end": "05:30 pm"}] },
"Wednesday": { "type": "open", "slots": [{"start": "05:00 am", "end": "05:30 pm"}] },
"Thursday": { "type": "open", "slots": [{"start": "05:00 am", "end": "05:30 pm"}] },
"Friday": { "type": "split", "slots": [{"start": "05:00 am", "end": "10:30 pm"},{"start": "12:00 pm", "end": "05:30 pm"}] },
"Saturday": { "type": "closed" },
"Sunday": { "type": "24h" }
}
}
}
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
Sample Response :
{
"success": true,
"result": {
"id": 6730,
"name": "Saravanaa Bhavan",
"street": "1305 South Mary Avenue",
"city": "Sunnyvale",
"state_name": "California",
"postal_code": "94087",
"phone": "408-616-5577",
"biz_url": "http://saravanaabhavan-ca.com/"
}
}
Endpoint : /businesses/<:business_id>
Type : PUT
Authentication: auth_token and user_email
Name | Type | Description | Mandatory |
---|---|---|---|
name | string | Name of business | Yes |
street | string | Street address of business | Yes |
city | string | City of business | Yes |
state_id | number | Unique state identifier obtained from here | Yes |
country_id | number | Unique country identifier obtained from here | Yes |
postal_code | string | Postal code of business | Yes |
phone | string | Phone of business | Yes |
biz_url | string | Website of business | No |
sub_category_id | number | Unique sub category identifier obtained from here. Only primary: true Sub Category is allowed. |
Yes |
year_of_inc | string | Year of Incorporation of business | No |
description | string | Description of the business. | Yes |
storecode | string | Store code of the business. | No |
location_biz_hour_attributes | array | (to be deprecated by 15th Mar. ‘18) Hours of operation of the business. Individual attributes described below. | No |
biz_hours | hash | (replaced location_biz_hour_attributes)Hours of operation of the business. Individual attributes described below. | No |
location_photos_attributes | array | Photo urls of the business. Individual attributes described below. | No |
video_attributes | array | Video links of the business. Individual attributes described below. | No |
payment_methods_attributes | array | Methods of payment accepted by the business. Individual attributes described below. | No |
additional_categories | array | All additional category identifier obtained from here. Max 9 additional categories allowed. | No |
Hours of Operation
Old Details (to be deprecated by 15th Mar. '18)
Old operation hours payload:
"location_biz_hours_attributes": [
{ "day": "Monday", "holiday": false, "start_time": "05:00am", "end_time": "05:30pm"},
{ "day": "Tuesday", "holiday": false, "start_time": "09:00am", "end_time": "08:00pm"},
{ "day": "Wednesday", "holiday": false, "start_time": "09:00am", "end_time": "08:00pm"},
{ "day": "Thursday", "holiday": false, "start_time": "09:00am", "end_time": "08:00pm"},
{ "day": "Friday", "holiday": false, "start_time": "09:00am", "end_time": "08:00pm"},
{ "day": "Saturday", "holiday": true},
{ "day": "Sunday", "holiday": true}
]
Name | Type | Description |
---|---|---|
day | string | Can be one among “Monday”, “Tuesday”, “Wednesday”, “Thursday”, “Friday”, “Saturday”, “Sunday” |
holiday | boolean | Indicates if the business is closed on that particular day. |
start_time | string | Opening hours of business on that particular day. Format is “hh:mmam/pm”. Example: 10:00am |
end_time | string | Closing hours of business on that particular day. Format is “hh:mmam/pm”. Example: 10:00pm |
New details
New payload or biz_hours is a hash of following type:
"biz_hours": {
"days": {
"Monday": {"type": "open", "slots": [{ "start": "05:00am", "end": "05:30pm"}]},
"Tuesday": {"type": "open", "slots": [{ "start": "05:00am", "end": "05:30pm"}]},
"Wednesday": {"type": "open", "slots": [{ "start": "05:00am", "end": "05:30pm"}]},
"Thursday": {"type": "open", "slots": [{ "start": "05:00am", "end": "05:30pm"}]},
"Friday": {"type": "split", "slots": [{ "start": "05:00am", "end": "12:30pm"},{ "start": "01:00pm", "end": "05:30pm"}]},
"Saturday": {"type": "closed"},
"Sunday": {"type": "24h"}
}
}
Name | Type | Description |
---|---|---|
day | string | Can be one among “Monday”, “Tuesday”, “Wednesday”, “Thursday”, “Friday”, “Saturday”, “Sunday” |
type | string | Indicates if the type of business hours for the day. Possible values are “closed”, “split”, “24h”, “open” |
slot | hash | Eash slot represents a pair of start and end times. It is an hash having two keys “start” and “end” representing start_time and end_time of slot respectively. |
start/end | string | Opening and Closing hours of business on that particular slot of day. Format is “hh:mm am/pm” in 12 hours format or “HHMM” in 24 hours format |
slots | array | Its an array of slot(hashes) that each day comprises of. If type is “open” array should have only one slot. If type is “split” the array should have two slots. Slots aren’t required at all for the case of “closed” and “24h” |
Note: Hours of operation have to be provided for all 7 days in a week or NONE at all.
Error Responses:
When the wrong auth_token or user_email parameters are passed in the request.
{
"success": false,
"message": "Authentication Failure"
}
When the wrong business id is passed in the request.
{
"success": false,
"message": "This business doesn't exist"
}
When the wrong state id is passed in the request.
{
"success": false,
"message": "The business was not created. State can't be blank."
}
When the wrong subcategory id is passed in the request.
{
"success": false,
"message": "The business was not created. Sub Category can't be blank."
}
When any attribute validation fails.
{
"success": false,
"message": "The business was not created. Name is too short (minimum is 2 characters). Phone Invalid Phone number(format: 934-344-5423)"
}
Photos
Name | Type | Description |
---|---|---|
photo | string | Web url to the photo |
Video
Name | Type | Description |
---|---|---|
link | string | Web url to the video |
Payment Methods
Name | Type | Description |
---|---|---|
name | string | Type of payment method. Can be one among “Visa”, “Cash”, “Cheque”, “Master Card”, “American Express” |
is_accepted | boolean | Indicates the acceptance of the particular payment method. |
Archive
Archive a business.
Sample Request : POST v2.synup.com/api/v2/businesses/6731/archive.json
<?php
$request = new HttpRequest();
$request->setUrl('https://v2.synup.com/api/v2/businesses/1617/archive');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData(array(
'user_email' => '<YOUR EMAIL>',
'auth_token' => '<YOUR AUTH_TOKEN>'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
import requests
url = "https://v2.synup.com/api/v2/businesses/1617/archive"
querystring = {"user_email":"<YOUR EMAIL>","auth_token":"<YOUR AUTH_TOKEN>"}
response = requests.request("POST", url, params=querystring)
print(response.text)
require 'uri'
require 'net/http'
url = URI("https://v2.synup.com/api/v2/businesses/1617/archive?user_email=%3CYOUR%20EMAIL%3E&auth_token=%3CYOUR%20AUTH_TOKEN%3E")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
curl -X POST \
'https://v2.synup.com/api/v2/businesses/1617/archive?user_email=<YOUR EMAIL>&auth_token=<YOUR AUTH_TOKEN>'
var request = require("request");
var options = { method: 'POST',
url: 'https://v2.synup.com/api/v2/businesses/1617/archive',
qs: { user_email: '<YOUR EMAIL>', auth_token: '<YOUR AUTH_TOKEN>' } };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
Sample Response :
{
"success": true
}
Error Responses:
- When the wrong auth_token or user_email parameters are passed in the request.
{
"success": false,
"message": "Authentication Failure"
}
- When the wrong business id is passed in the request.
{
"success": false,
"message": "This business doesn't exist"
}
Endpoint : /businesses/<:business_id>/archive
Type : POST
Authentication: auth_token and user_email
Name | Type | Description |
---|---|---|
business_id | number | Unique business identifier |
Listings
Get details of all listings of a particular business.
Sample Request : GET v2.synup.com/api/v2/businesses/6730/listings.json
curl -X GET \
'https://v2.synup.com/api/v2/businesses/6730/listings.json?auth_token=<YOUR AUTH_TOKEN>&user_email=<YOUR EMAIL>'
var request = require("request");
var options = { method: 'GET',
url: 'https://v2.synup.com/api/v2/businesses/6730/listings.json',
qs: { auth_token: '<YOUR AUTH_TOKEN>', user_email: '<YOUR EMAIL>' } };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
<?php
$request = new HttpRequest();
$request->setUrl('https://v2.synup.com/api/v2/businesses/6730/listings.json');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData(array(
'auth_token' => '<YOUR AUTH_TOKEN>',
'user_email' => '<YOUR EMAIL>'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
import requests
url = "https://v2.synup.com/api/v2/businesses/6730/listings.json"
querystring = {"auth_token":"<YOUR AUTH_TOKEN>","user_email":"<YOUR EMAIL>"}
response = requests.request("GET", url, params=querystring)
print(response.text)
require 'uri'
require 'net/http'
url = URI("https://v2.synup.com/api/v2/businesses/6730/listings.json?auth_token=<YOUR AUTH_TOKEN>&user_email=<YOUR EMAIL>")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
Sample Response :
{
"success": true,
"result": [
{
"id": 1180625,
"site_username": null,
"site_password": null,
"sync_status": "in progress",
"site_name": "Google Maps",
"status": "Inaccurate"
},
{
"id": 1180571,
"site_username": null,
"site_password": null,
"order_status": "success",
"name": "Saravana Bhavan",
"name_valid": true,
"phone": "(408) 616-7755",
"phone_valid": true,
"street": "1305 S Mary Ave",
"city": "Sunnyvale",
"state": "CA",
"postal_code": "94087",
"address_valid": true,
"live_link": "http://foursquare.com/venue/458e49d4f964a52011401fe3",
"claimed": null,
"site_name": "Foursquare",
"status": "Accurate"
}
]
}
Error Responses:
When the wrong auth_token or user_email parameters are passed in the request.
{
"success": false,
"message": "Authentication Failure"
}
When the wrong business id is passed in the request.
{
"success": false,
"message": "This business doesn't exist"
}
Endpoint : /businesses/<:business_id>/listings
Type : GET
Authentication: auth_token and user_email
Name | Type | Description |
---|---|---|
business_id | number | Unique business identifier |
Name | Type | Description |
---|---|---|
id | number | Unique listing identifier |
site_username | string | Username to login to listing directory if required |
site_password | string | Password to login to listing directory if required |
sync_status | string | Sync status of listing. Can be one of ‘success’, ‘error’ or ‘in progress’ |
name | string | Name of business on listing directory |
name_valid | boolean | Indicates whether name is a match with user entered data |
phone | string | Phone of business on listing directory |
phone_valid | boolean | Indicates whether phone is a match with user entered data |
street | string | Street address of business on listing directory |
state | string | State of business on listing directory |
city | string | City of business on listing directory |
postal_code | string | Postal code of business on listing directory |
address_valid | boolean | Indicates whether address is a match with user entered data |
live_link | number | Unique link of listing on directory |
claimed | boolean | Claim status of the listing |
site_name | string | Name of the listing directory |
status | string | Status of the listing on the directory. Can be one of ‘Accurate’, ‘Inaccurate’ or ‘Not Present’ |
Reviews
Reviews of a Business
Get all reviews of a particular business.
Sample Request : GET v2.synup.com/api/v2/businesses/6731/reviews.json
curl -X GET \
'https://v2.synup.com/api/v2/businesses/6731/reviews.json?auth_token=<YOUR AUTH_TOKEN>&user_email=<YOUR EMAIL>'
var request = require("request");
var options = { method: 'GET',
url: 'https://v2.synup.com/api/v2/businesses/6731/reviews.json',
qs: { auth_token: '<YOUR AUTH_TOKEN>', user_email: '<YOUR EMAIL>' } };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
require 'uri'
require 'net/http'
url = URI("https://v2.synup.com/api/v2/businesses/6731/reviews.json?auth_token=<YOUR AUTH_TOKEN>&user_email=<YOUR EMAIL>")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
import requests
url = "https://v2.synup.com/api/v2/businesses/6731/reviews.json"
querystring = {"auth_token":"<YOUR AUTH_TOKEN>","user_email":"<YOUR EMAIL>"}
response = requests.request("GET", url, params=querystring)
print(response.text)
<?php
$request = new HttpRequest();
$request->setUrl('https://v2.synup.com/api/v2/businesses/6731/reviews.json');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData(array(
'auth_token' => '<YOUR AUTH_TOKEN>',
'user_email' => '<YOUR EMAIL>'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
Sample Response :
{
"success": true,
"result": {
"Yellowpages": [
{
"id": "c5df698b-25c5-492e-836c-405c6461cb0e",
"title": "Did a great job",
"content": "I had them out to unclog my sink that was clogging up. They were quick, neat professional and didn't charge an arm and a leg.",
"author_name": "Haveaniceday12",
"author_avatar": null,
"rating": 10,
"date": "2012-05-07",
"permalink": "http://www.yellowpages.com/north-hollywood-ca/mip/little-tonis-pizzeria-restaurant-15724831?lid=1000287178114",
"type": "Review",
"can_respond": false,
"responses": []
},
{
"id": "c47e4eed-3a3f-4d35-97c8-0ee2e004db0c",
"title": "Top Notch Service",
"content": "I had them out to fix several minor plumbing issues in my house. They were experienced and knowledgable. The bill ended up being less than I though it would run and they even fixed a bathroom fan and door for me while they were working at no extra charge. Definitely a great service!",
"author_name": "Footballfan16",
"author_avatar": null,
"rating": 10,
"date": "2011-12-20",
"permalink": "http://www.yellowpages.com/north-hollywood-ca/mip/little-tonis-pizzeria-restaurant-15724831?lid=1000287178114",
"type": "Review",
"can_respond": false,
"responses": []
}
],
"Google Maps": [
{
"id": "9ab75e4c-27f9-4b9e-baeb-813838f7afa4",
"title": null,
"content": "Came on time and got the job done in a timely manner.",
"author_name": "Tyler Martin",
"author_avatar": "http://lh3.googleusercontent.com/-_WRzAyocYns/AAAAAAAAAAI/AAAAAAAAAlc/QIheM_Dt_lA/s46-c-k-no/photo.jpg",
"rating": 10,
"date": "2013-08-13",
"permalink": "https://www.google.co.in/search?q=Radisson+Blu+Hotel+Chennai+City+Centre,+2+Ethiraj+Salai,+C-in-c+Road,+Egmore,+Chennai,+Tamil+Nadu+600008&ludocid=14029168490467522605#lrd=0x3a526614093abc83:0xc2b19e69906b782d,1",
"type": "Review",
"can_respond": false,
"responses": [
{
"id": "c69412d4-511a-4642-bb39-80561de5d594",
"title": null,
"content": "Thank you for the review and we look forward to seeing you at Kings again soon.",
"author_name": "owner",
"author_avatar": null,
"date": "2017-01-23"
}
]
}
],
"Facebook" :[
{
"id": "a52713bc-a95b-47af-ac26-6ca0ffcd501f",
"title": null,
"content": "Dedicated team, Living upto expectations, All the best",
"author_name": "Christy Maxwell",
"author_avatar": "http://graph.facebook.com/1348098948527216/picture",
"rating": 10,
"date": "2017-08-22T10:08:31.070Z",
"permalink": "https://www.facebook.com/autocodetech123/posts/891832324270537:0",
"type": "LikesCount",
"likes_count": 269,
"likes_change": 269,
"can_respond": false,
"responses": []
},
{
"id": "4980a2dc-66be-415d-8a7a-67171e198b3a",
"title": null,
"content": "",
"author_name": "Peter Parker",
"author_avatar": "http://graph.facebook.com/10208573234209398/picture",
"rating": 10,
"date": "2017-08-17T15:45:16.000Z",
"permalink": "https://www.facebook.com/autocodetech123/posts/891832324270537:0",
"type": "Review",
"likes_count": null,
"likes_change": null,
"can_respond": false,
"responses": [
{
"id": "c67b8bc8-c801-4eb0-9d0a-f4586fd37c5a",
"title": null,
"content": "Thanks you!",
"author_name": "Autocode Tech Services",
"author_avatar": "http://graph.facebook.com/802628656524927/picture",
"date": "2017-08-22T10:09:41.000Z"
}
]
},
{
"id": "6dbb077c-c60f-4b09-b946-5f2d34ef895a",
"title": null,
"content": "Appreciated Work, Good Job",
"author_name": "Tyler Martin",
"author_avatar": "http://graph.facebook.com/1421484597888132/picture",
"rating": null,
"date": "2017-08-02T11:09:01.000Z",
"permalink": null,
"type": "Message",
"likes_count": null,
"likes_change": null,
"can_respond": false,
"responses": [
{
"id": "fbaf39ea-edce-4188-a297-f488e61537eb",
"title": null,
"content": "Thank you",
"author_name": "Autocode Tech Services",
"author_avatar": "http://graph.facebook.com/802621345524927/picture",
"date": "2017-08-02T11:57:01.000Z"
}
]
}
]
}
}
Error Responses:
- When the wrong auth_token or user_email parameters are passed in the request.
{
"success": false,
"message": "Authentication Failure"
}
- When the wrong business id is passed in the request.
{
"success": false,
"message": "This business doesn't exist"
}
Endpoint : /businesses/<:business_id>/reviews
Type : GET
Authentication: auth_token and user_email
Name | Type | Description |
---|---|---|
business_id | number | Unique business identifier |
Query Params
Name | Type | Description |
---|---|---|
category(optional) | text | category can either be review or social |
Different Types of Reviews
["Photo", "Comment", "Tweet", "Attraction", "LikesCount", "Message", "Review"]
Name | Type | Description |
---|---|---|
id | uuid | Unique review identifier |
title | string | Title of review |
content | string | Content of review |
author_name | string | Name of the author who wrote the review |
author_avatar | string | Avatar image for the author who wrote the review |
rating | string | Rating of review if available |
date | string | Date of when review was written |
permalink | string | Review Response URL |
type | string | Type of Review |
can_respond | boolean | Flag to specify whether you can respond to the review via the API |
responses | array | Contains array of responses for the review. |
Respond to Review
Respond to a particular review. This works only for reviews on Facebook, Google and Yelp listings.
Sample Request : POST v2.synup.com/api/v2/businesses/6911/reviews/0e9d768f-320a-4860-8165-66b31f622942/responses/
<?php
$request = new HttpRequest();
$request->setUrl('https://v2.synup.com/api/v2/businesses/6911/reviews/0e9d768f-320a-4860-8165-66b31f622942/responses');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData(array(
'auth_token' => '<Your AUTH_TOKEN>',
'user_email' => '<Your EMAIL>'
));
$request->setHeaders(array(
'content-type' => 'application/json'
));
$request->setBody('{ "content": "Thank you" }');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
curl -X POST \
'https://v2.synup.com/api/v2/businesses/6911/reviews/0e9d768f-320a-4860-8165-66b31f622942/responses?auth_token=<Your AUTH_TOKEN>&user_email=<Your EMAIL>' \
-H 'content-type: application/json' \
-d '{ "content": "Thank you" }'
import requests
url = "https://v2.synup.com/api/v2/businesses/6911/reviews/0e9d768f-320a-4860-8165-66b31f622942/responses"
querystring = {"auth_token":"<Your AUTH_TOKEN>","user_email":"<Your EMAIL>"}
payload = "{ \"content\": \"Thank you\" }"
headers = {'content-type': 'application/json'}
response = requests.request("POST", url, data=payload, headers=headers, params=querystring)
print(response.text)
require 'uri'
require 'net/http'
url = URI("https://v2.synup.com/api/v2/businesses/6911/reviews/0e9d768f-320a-4860-8165-66b31f622942/responses?auth_token=<Your AUTH_TOKEN>&user_email=<Your EMAIL>")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{ \"content\": \"Thank you\" }"
response = http.request(request)
puts response.read_body
var request = require("request");
var options = { method: 'POST',
url: 'https://v2.synup.com/api/v2/businesses/6911/reviews/0e9d768f-320a-4860-8165-66b31f622942/responses',
qs: { auth_token: '<Your AUTH_TOKEN>', user_email: '<Your EMAIL>' },
headers: { 'content-type': 'application/json' },
body: { content: 'Thank you' },
json: true };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
Query String:
"content": "Thanks for the review!"
Sample Response :
{
"success": true,
"message": "Request successfully submitted.",
"request_id": 1203
}
Error Responses:
- When the wrong auth_token or user_email parameters are passed in the request.
{
"success": false,
"message": "Authentication Failure"
}
When a review does not exist.
json { "success": false, "message": "Review ID is invalid." }
When the review content field is not specified
{
"success": false,
"message": "Review content is empty."
}
- When the review does not pertain to a business that you have added
{
"success": false,
"message": "Review must pertain to a business you've added."
}
- When the credentials for the site in question haven’t been set
{
"success": false,
"message": "Site credentials have not been set."
}
- When the respond operation is not supported for the site in question
{
"success": false,
"message": "This operation is currently not supported for this site."
}
- When the review in question already has a response
{
"success": false,
"message": "A response already exists for this review."
}
- When the review in question already has a response submission in progress
{
"success": false,
"message": "There is already a response submission in progress."
}
- When the review in question already has a response submitted successfully
{
"success": false,
"message": "A response has already been submitted successfully."
}
- When the review in question already has a response submitted previously which failed
{
"success": false,
"message": "A response has been submitted previously, which failed."
}
Endpoint : businesses/<:business_id>/reviews/<:review_id>/responses/
Type : POST
Authentication: auth_token and user_email
Parameters:
Name | Type | Description |
---|---|---|
business_id | number | Unique business identifier |
review_id | uuid | Unique review identifier |
content | string | The content of the response |
Status of Review Response
Sample Request : GET v2.synup.com/api/v2/businesses/6911/reviews/399444/responses/537ad894-4b0b-41c9-b4c5-d6af46ca88b7
curl -X GET \
'https://v2.synup.com/api/v2/businesses/6911/reviews/4e596d0b-f7c6-47bd-91d6-6b1dc4acd12a/responses/537ad894-4b0b-41c9-b4c5-d6af46ca88b7?auth_token=<Your AUTH_TOKEN>&user_email=<Your EMAIL>'
require 'uri'
require 'net/http'
url = URI("https://v2.synup.com/api/v2/businesses/6911/reviews/4e596d0b-f7c6-47bd-91d6-6b1dc4acd12a/responses/537ad894-4b0b-41c9-b4c5-d6af46ca88b7?auth_token=<Your AUTH_TOKEN>&user_email=<Your EMAIL>")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
import requests
url = "https://v2.synup.com/api/v2/businesses/6911/reviews/4e596d0b-f7c6-47bd-91d6-6b1dc4acd12a/responses/537ad894-4b0b-41c9-b4c5-d6af46ca88b7"
querystring = {"auth_token":"<Your AUTH_TOKEN>","user_email":"<Your EMAIL>"}
response = requests.request("GET", url, params=querystring)
print(response.text)
<?php
$request = new HttpRequest();
$request->setUrl('https://v2.synup.com/api/v2/businesses/6911/reviews/4e596d0b-f7c6-47bd-91d6-6b1dc4acd12a/responses/537ad894-4b0b-41c9-b4c5-d6af46ca88b7');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData(array(
'auth_token' => '<Your AUTH_TOKEN>',
'user_email' => '<Your EMAIL>'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
var request = require("request");
var options = { method: 'GET',
url: 'https://v2.synup.com/api/v2/businesses/6911/reviews/4e596d0b-f7c6-47bd-91d6-6b1dc4acd12a/responses/537ad894-4b0b-41c9-b4c5-d6af46ca88b7',
qs: { auth_token: '<Your AUTH_TOKEN>', user_email: '<Your EMAIL>' } };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
Responses :
- When the request has completed successfully
{
"status": "Completed"
}
- When the request has just been created
{
"status": "Created"
}
- When the request is in progress
{
"status": "In Progress"
}
- When the request has failed
{
"status": "Failed"
}
- When the request has failed once and a retry is in progress
{
"status": "Retry In Progress"
}
Error Responses:
- When the wrong auth_token or user_email parameters are passed in the request.
{
"success": false,
"message": "Authentication Failure"
}
- When the request does not exist.
{
"success": false,
"message": "Invalid Request ID"
}
Endpoint : /businesses/<:business_id>/reviews/<:review_id>/responses/<:request_id>
Type : GET
Authentication: auth_token and user_email
Parameters:
Name | Type | Description |
---|---|---|
business_id | number | Unique business identifier |
review_id | uuid | Unique review identifier |
request_id | uuid | Unique request identifier |
Rankings & Keywords
Rankings
Get all rankings pertaining to a location.
Sample Request : GET v2.synup.com/api/v2/businesses/48/rankings.json
var request = require("request");
var options = { method: 'GET',
url: 'https://v2.synup.com/api/v2/businesses/48/rankings.json',
qs: { auth_token: '<Your AUTH_TOKEN>', user_email: '<Your EMAIL>' } };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
<?php
$request = new HttpRequest();
$request->setUrl('https://v2.synup.com/api/v2/businesses/48/rankings.json');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData(array(
'auth_token' => '<Your AUTH_TOKEN>',
'user_email' => '<Your EMAIL>'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
import requests
url = "https://v2.synup.com/api/v2/businesses/48/rankings.json"
querystring = {"auth_token":"<Your AUTH_TOKEN>","user_email":"<Your EMAIL>"}
response = requests.request("GET", url, params=querystring)
print(response.text)
require 'uri'
require 'net/http'
url = URI("https://v2.synup.com/api/v2/businesses/48/rankings.json?auth_token=<Your AUTH_TOKEN>&user_email=<Your EMAIL>")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
curl -X GET \
'https://v2.synup.com/api/v2/businesses/48/rankings.json?auth_token=<Your AUTH_TOKEN>&user_email=<Your EMAIL>'
Sample Response :
{
"success": true,
"result": {
"doc thompson plumbing columbus": {
"Google Maps": 1,
"Google_new": {
"local": 4, "organic": 8
}
},
"Google": 1,
"Yahoo Local": 1,
"Yahoo": 1,
"Bing": 2,
"Yelp": "-",
"Yellowpages": 1
},
"plumbing": {
"Google Maps": "-",
"Google_new": {
"local": 4, "organic": 8
}
},
"Google": "-",
"Yahoo Local": 76,
"Yahoo": "-",
"Bing": "-",
"Yelp": "-",
"Yellowpages": "-"
}
}
}
Error Responses:
- When the wrong auth_token or user_email parameters are passed in the request.
{
"success": false,
"message": "Authentication Failure"
}
- When the wrong business id is passed in the request.
{
"success": false,
"message": "This business doesn't exist"
}
Endpoint : /api/v2/businesses/<:business_id>/rankings.json
Type : GET
Authentication: auth_token and user_email
Name | Type | Description |
---|---|---|
business_id | number | Unique business identifier |
Keywords
Get details of all keywords of a particular business.
Sample Request : GET v2.synup.com/api/v2/businesses/6730/keywords.json
var request = require("request");
var options = { method: 'GET',
url: 'v2.synup.com/api/v2/businesses/6730/keywords.json',
qs: { auth_token: '<Your AUTH_TOKEN>', user_email: '<Your EMAIL>' } };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
<?php
$request = new HttpRequest();
$request->setUrl('v2.synup.com/api/v2/businesses/6730/keywords.json');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData(array(
'auth_token' => '<Your AUTH_TOKEN>',
'user_email' => '<Your EMAIL>'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
import requests
url = "v2.synup.com/api/v2/businesses/6730/keywords.json"
querystring = {"auth_token":"<Your AUTH_TOKEN>","user_email":"<Your EMAIL>"}
response = requests.request("GET", url, params=querystring)
print(response.text)
require 'uri'
require 'net/http'
url = URI("v2.synup.com/api/v2/businesses/6730/keywords.json?auth_token=<Your AUTH_TOKEN>&user_email=<Your EMAIL>")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
curl -X GET \
'v2.synup.com/api/v2/businesses/6730/keywords.json?auth_token=<Your AUTH_TOKEN>&user_email=<Your EMAIL>'
Sample Response :
{
"success": true,
"result": [
{
"id": 2895,
"keyword": "abcd1",
"city": "Philadelphia",
"state": "PA",
"primary": null,
"location_id": 948,
"archived": false
},
{
"id": 2894,
"keyword": "abcd",
"city": "Philadelphia",
"state": "PA",
"primary": true,
"location_id": 948,
"archived": false
}
]
}
Error Responses:
- When the wrong auth_token or user_email parameters are passed in the request.
{
"success": false,
"message": "Authentication Failure"
}
- When the wrong business id is passed in the request.
{
"success": false,
"message": "Invalid location id"
}
Endpoint : /businesses/<:business_id>/keywords
Type : GET
Authentication: auth_token and user_email
Name | Type | Description |
---|---|---|
business_id | number | Unique business identifier |
Name | Type | Description |
---|---|---|
id | number | Unique keyword identifier |
keyword | string | Keyword string |
city | string | City in which keyword will be searched for ranking |
state | string | state in which keyword will be searched for ranking |
primary | string | Primary keyword is the first keyword added. Used for reporting purposes |
location_id | number | Indicates the business identifier |
archived | boolean | Indicates whether the keyword is archived and not used anymore |
Add Keyword
Add a new keyword to a particular business.
Sample Request : POST v2.synup.com/api/v2/businesses/6730/add_keyword
curl -X POST \
'https://v2.synup.com/api/v2/businesses/6730/add_keyword?auth_token=<Your AUTH_TOKEN>&user_email=<Your EMAIL>' \
-H 'content-type: application/json' \
-d '{ "keyword": "keyowrd to be added" }'
import requests
url = "https://v2.synup.com/api/v2/businesses/6730/add_keyword"
querystring = {"auth_token":"<YOUR AUTH_TOKEN>","user_email":"<YOUR EMAIL>"}
payload = "{ \"keyword\": \"keyowrd to be added\" }"
headers = {'content-type': 'application/json'}
response = requests.request("POST", url, data=payload, headers=headers, params=querystring)
print(response.text)
require 'uri'
require 'net/http'
url = URI("https://v2.synup.com/api/v2/businesses/6730/add_keyword?auth_token=<Your AUTH_TOKEN>&user_email=<Your EMAIL>")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{ \"keyword\": \"keyowrd to be added\" }"
response = http.request(request)
puts response.read_body
<?php
$request = new HttpRequest();
$request->setUrl('https://v2.synup.com/api/v2/businesses/6730/add_keyword');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData(array(
'auth_token' => '<YOUR AUTH_TOKEN>',
'user_email' => '<YOUR EMAIL>'
));
$request->setHeaders(array(
'content-type' => 'application/json'
));
$request->setBody('{ "keyword": "keyowrd to be added" }');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
var request = require("request");
var options = { method: 'POST',
url: 'https://v2.synup.com/api/v2/businesses/6730/add_keyword',
qs: { auth_token: '<YOUR AUTH_TOKEN>', user_email: '<YOUR EMAIL>' },
headers: { 'content-type': 'application/json' },
body: { keyword: 'keyowrd to be added' },
json: true };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
Sample Response :
{
"success": true,
"result": {
"id": 2896,
"keyword": "abcd2",
"city": "Philadelphia",
"state": "PA",
"primary": null,
"location_id": 948,
"archived": false
}
}
Error Responses:
- When the wrong auth_token or user_email parameters are passed in the request.
{
"success": false,
"message": "Authentication Failure"
}
- When the wrong business id is passed in the request.
{
"success": false,
"message": "Invalid location id"
}
Endpoint : /businesses/<:business_id>/add_keyword
Type : POST
Authentication: auth_token and user_email
Name | Type | Description |
---|---|---|
business_id | number | Unique business identifier |
Body Params(form data)
Name | Type | Description |
---|---|---|
keyword | string | specific keyword to be added |
Name | Type | Description |
---|---|---|
id | number | Unique keyword identifier |
keyword | string | Keyword string |
city | string | City in which keyword will be searched for ranking |
state | string | state in which keyword will be searched for ranking |
primary | string | Primary keyword is the first keyword added. Used for reporting purposes |
location_id | number | Indicates the business identifier |
archived | boolean | Indicates whether the keyword is archived and not used anymore |
Delete Keyword
Delete an existing keyword from a particular business.
Sample Request : DELETE v2.synup.com/api/v2/keywords/2896
curl -X DELETE \
'https://v2.synup.com/api/v2/keywords/2896?auth_token=<Your AUTH_TOKEN>&user_email=<Your EMAIL>'
<?php
$request = new HttpRequest();
$request->setUrl('https://v2.synup.com/api/v2/keywords/2896');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData(array(
'auth_token' => '<YOUR AUTH_TOKEN>',
'user_email' => '<YOUR EMAIL>'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
require 'uri'
require 'net/http'
url = URI("https://v2.synup.com/api/v2/keywords/2896?auth_token=<YOUR AUTH_TOKEN>&user_email=<YOUR EMAIL>")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
import requests
url = "https://v2.synup.com/api/v2/keywords/2896"
querystring = {"auth_token":"<YOUR AUTH_TOKEN>","user_email":"<YOUR EMAIL>"}
response = requests.request("DELETE", url, params=querystring)
print(response.text)
var request = require("request");
var options = { method: 'DELETE',
url: 'https://v2.synup.com/api/v2/keywords/2896',
qs: { auth_token: '<YOUR AUTH_TOKEN>', user_email: '<YOUR EMAIL>' } };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
Sample Response :
{
"success": true,
"result": "Keyword abcd2[2896] is successfully deleted"
}
Error Responses:
- When the wrong auth_token or user_email parameters are passed in the request.
{
"success": false,
"message": "Authentication Failure"
}
- When the wrong business id is passed in the request.
{
"success": false,
"message": "Invalid keyword id"
}
Endpoint : keywords/<:keyword_id>
Type : DELETE
Authentication: auth_token and user_email
Name | Type | Description |
---|---|---|
keyword_id | number | Unique keyword identifier |
Places
States
Get all states for a country in which a business can be added.
Sample Request : GET v2.synup.com/api/v2/countries/1/states.json
curl -X GET \
'https://v2.synup.com/api/v2/countries/233/states.json?auth_token=<YOUR AUTH_TOKEN>&user_email=<YOUR EMAIL>'
var request = require("request");
var options = { method: 'GET',
url: 'https://v2.synup.com/api/v2/countries/1/states.json',
qs: { auth_token: '<YOUR AUTH_TOKEN>', user_email: '<YOUR EMAIL>' } };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
require 'uri'
require 'net/http'
url = URI("https://v2.synup.com/api/v2/countries/1/states.json?auth_token=<YOUR AUTH_TOKEN>&user_email=<YOUR EMAIL>")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
import requests
url = "https://v2.synup.com/api/v2/countries/1/states.json"
querystring = {"auth_token":"<YOUR AUTH_TOKEN>","user_email":"<YOUR EMAIL>"}
response = requests.request("GET", url, params=querystring)
print(response.text)
<?php
$request = new HttpRequest();
$request->setUrl('https://v2.synup.com/api/v2/countries/1/states.json');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData(array(
'auth_token' => '<YOUR AUTH_TOKEN>',
'user_email' => '<YOUR EMAIL>'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
Sample Response :
{
"success": true,
"result": [
{
"id": 3510,
"name": "Arkansas",
"iso": "AR",
"country_id": 233
},
{
"id": 3511,
"name": "Washington, D.C.",
"iso": "DC",
"country_id": 233
},
{
"id": 3516,
"name": "Louisiana",
"iso": "LA",
"country_id": 233
},
{
"id": 3560,
"name": "Virginia",
"iso": "VA",
"country_id": 233
}
]
}
Error Responses:
- When the wrong auth_token or user_email parameters are passed in the request.
{
"success": false,
"message": "Authentication Failure"
}
Endpoint : /countries/<:country_id>/states
Type : GET
Authentication: auth_token and user_email
Name | Type | Description |
---|---|---|
id | number | Unique country identifier |
name | string | Name of state |
iso | string | Shortcode of state |
Countries
Get all countries for which businesses can be added.
Sample Request : GET v2.synup.com/api/v2/countries.json
curl -X GET \
'https://v2.synup.com/api/v2/countries.json?auth_token=<YOUR AUTH_TOKEN>&user_email=<YOUR EMAIL>'
var request = require("request");
var options = { method: 'GET',
url: 'https://v2.synup.com/api/v2/countries.json',
qs: { auth_token: '<YOUR AUTH_TOKEN>', user_email: '<YOUR EMAIL>' } };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
require 'uri'
require 'net/http'
url = URI("https://v2.synup.com/api/v2/countries.json?auth_token=<YOUR AUTH_TOKEN>&user_email=<YOUR EMAIL>")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
import requests
url = "https://v2.synup.com/api/v2/countries.json"
querystring = {"auth_token":"<YOUR AUTH_TOKEN>","user_email":"<YOUR EMAIL>"}
response = requests.request("GET", url, params=querystring)
print(response.text)
<?php
$request = new HttpRequest();
$request->setUrl('https://v2.synup.com/api/v2/countries.json');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData(array(
'auth_token' => '<YOUR AUTH_TOKEN>',
'user_email' => '<YOUR EMAIL>'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
Sample Response :
{
"success": true,
"result": [
{
"id": 233,
"name": "United States"
},
{
"id": 38,
"name": "Canada"
}
]
}
Error Responses:
- When the wrong auth_token or user_email parameters are passed in the request.
{
"success": false,
"message": "Authentication Failure"
}
Endpoint : /countries
Type : GET
Authentication: auth_token and user_email
Name | Type | Description |
---|---|---|
id | number | Unique country identifier |
name | string | Name of country |
SubCategories
List
Get all subcategories for a businesses.
Sample Request : v2.synup.com/api/v2/sub_categories.json
curl -X GET \
'https://v2.synup.com/api/v2/sub_categories.json?auth_token=<YOUR AUTH_TOKEN>&user_email=<YOUR EMAIL>'
var request = require("request");
var options = { method: 'GET',
url: 'https://v2.synup.com/api/v2/sub_categories.json',
qs: { auth_token: '<YOUR AUTH_TOKEN>', user_email: '<YOUR EMAIL>' } };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
require 'uri'
require 'net/http'
url = URI("https://v2.synup.com/api/v2/sub_categories.json?auth_token=<YOUR AUTH_TOKEN>&user_email=<YOUR EMAIL>")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
import requests
url = "https://v2.synup.com/api/v2/sub_categories.json"
querystring = {"auth_token":"<YOUR AUTH_TOKEN>","user_email":"<YOUR EMAIL>"}
response = requests.request("GET", url, params=querystring)
print(response.text)
<?php
$request = new HttpRequest();
$request->setUrl('https://v2.synup.com/api/v2/sub_categories.json');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData(array(
'auth_token' => '<YOUR AUTH_TOKEN>',
'user_email' => '<YOUR EMAIL>'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
Sample Response :
{
"success": true,
"result": [
{
"id": 1,
"name": "Accountants"
},
{
"id": 2,
"name": "Acupuncture"
},
{
"id": 3,
"name": "Adult Education"
}
]
}
Error Responses:
- When the wrong auth_token or user_email parameters are passed in the request.
{
"success": false,
"message": "Authentication Failure"
}
Endpoint : /sub_categories
Type : GET
Authentication: auth_token and user_email
Name | Type | Description |
---|---|---|
id | number | Unique subcategory identifier |
name | string | Name of subcatgory |