Node v0.6+ compatibility #20

Closed
wants to merge 5 commits into
from
View
13 app.js
@@ -31,6 +31,7 @@ var express = require('express'),
query = require('querystring'),
url = require('url'),
http = require('http'),
+ https = require('https'),
crypto = require('crypto'),
redis = require('redis'),
RedisStore = require('connect-redis')(express);
@@ -521,8 +522,18 @@ function processRequest(req, res, next) {
console.log(util.inspect(options));
};
+ var doRequest;
+ if (options.protocol === 'https' || options.protocol === 'https:') {
+ console.log('Protocol: HTTPS');
+ options.protocol = 'https:'
+ doRequest = https.request;
+ } else {
+ console.log('Protocol: HTTP');
+ doRequest = http.request;
+ }
+
// API Call. response is the response from the API, res is the response we will send back to the user.
- var apiCall = http.request(options, function(response) {
+ var apiCall = doRequest(options, function(response) {
response.setEncoding('utf-8');
if (config.debug) {
console.log('HEADERS: ' + JSON.stringify(response.headers));
View
647 public/data/angieslist-dev.json
@@ -0,0 +1,647 @@
+{
+ "endpoints":[
+ {
+ "name":"Authentication",
+ "methods":[
+ {
+ "MethodName":"/authentication",
+ "Synopsis":"Authenticates a user and returns a temporary Auth Token",
+ "HTTPMethod":"GET",
+ "URI":"/authentication",
+ "parameters":[
+ {
+ "Name":"email",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"User email"
+ },
+ {
+ "Name":"password",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":" "
+ },
+ {
+ "Name":"client_id",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"The secret client_id provided to the API consumer by Angie's List"
+ },
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ },
+ {
+ "MethodName":"/authentication/tokeninfo",
+ "Synopsis":"Returns status of an Auth Token",
+ "HTTPMethod":"GET",
+ "URI":"/authentication/tokeninfo",
+ "parameters":[
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name":"Service Providers",
+ "methods":[
+ {
+ "MethodName":"/serviceprovider/search",
+ "Synopsis":"Search for Service Providers",
+ "HTTPMethod":"GET",
+ "URI":"/serviceprovider/search",
+ "parameters":[
+ {
+ "Name":"query",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"The search term(s) (or if searchtype is category the categoryId)"
+ },
+ {
+ "Name":"searchtype",
+ "Required":"N",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":["keyword","category","name"],
+ "Description":"The type of search to perform. Keyword searches against a text index. Name is targeted at just the name of the company. Category expects the query param to be the numeric categoryId of a specific category. If blank, we attempt to guess the user's intent."
+ },
+ {
+ "Name":"sortby",
+ "Required":"N",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":["CouponsFirst","GradesAToF","ReportsMaxToMin","MilesToHomeMinToMax","CompanyNameAToZ"],
+ "Description":"The order in which to return the search results. If blank it will default to CouponsFirst sort order."
+ },
+ {
+ "Name":"listtype",
+ "Required":"N",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":["Classic","Health","ClassicCar"],
+ "Description":"The specific list to search in. If blank, it will return results in the one with the most relevent results"
+ },
+ {
+ "Name":"pageSize",
+ "Required":"N",
+ "Default":"10",
+ "Type":"enumerated",
+ "EnumeratedList":[5,10,15,20,50],
+ "Description":"Number of records to return per page"
+ },
+ {
+ "Name":"page",
+ "Required":"N",
+ "Default":"0",
+ "Type":"int",
+ "Description":"Page index to retrieve (0 is the first page)"
+ },
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ },
+ {
+ "MethodName":"/serviceprovider/detail",
+ "Synopsis":"Details of a single Service Provider",
+ "HTTPMethod":"GET",
+ "URI":"/serviceprovider/detail",
+ "parameters":[
+ {
+ "Name":"serviceProviderId",
+ "Required":"Y",
+ "Default":"",
+ "Type":"int",
+ "Description":"The Service Provider ID"
+ },
+ {
+ "Name":"categoryId",
+ "Required":"N",
+ "Default":"",
+ "Type":"int",
+ "Description":"The Category ID to use to provide context for the details. If blank the data will be provided in context of a server determined 'default' category"
+ },
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ },
+ {
+ "MethodName":"/serviceprovider/reports",
+ "Synopsis":"List of reports for a Service Provider in a particular Category",
+ "HTTPMethod":"GET",
+ "URI":"/serviceprovider/reports",
+ "parameters":[
+ {
+ "Name":"serviceProviderId",
+ "Required":"Y",
+ "Default":"",
+ "Type":"int",
+ "Description":"The Service Provider ID"
+ },
+ {
+ "Name":"categoryId",
+ "Required":"Y",
+ "Default":"",
+ "Type":"int",
+ "Description":"The Category ID to use to provide context for the details. If blank the data will be provided in context of a server determined 'default' category"
+ },
+ {
+ "Name":"pageSize",
+ "Required":"N",
+ "Default":"10",
+ "Type":"enumerated",
+ "EnumeratedList":[5,10,15,20,50],
+ "Description":"Number of records to return per page"
+ },
+ {
+ "Name":"page",
+ "Required":"N",
+ "Default":"0",
+ "Type":"int",
+ "Description":"Page index to retrieve (0 is the first page)"
+ },
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name":"Deal Purchases",
+ "methods":[
+ {
+ "MethodName":"/dealpurchase/start",
+ "Synopsis":"Sets up an order for purchase of a deal item and returns the details for confirmation by the user.",
+ "HTTPMethod":"GET",
+ "URI":"/dealpurchase/start",
+ "parameters":[
+ {
+ "Name":"dealId",
+ "Required":"Y",
+ "Default":"",
+ "Type":"int",
+ "Description":"The ID of the initial deal item to be added to the order"
+ },
+ {
+ "Name":"quantity",
+ "Required":"N",
+ "Default":"1",
+ "Type":"int",
+ "Description":"The quantity of initial deal item to be added to the order"
+ },
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ },
+ {
+ "MethodName":"/dealpurchase/setcreditcardpaymentinfo",
+ "Synopsis":"Change or add the provided credit card payment instructions for use in the purchase.",
+ "HTTPMethod":"POST",
+ "URI":"/dealpurchase/setpaymentinfo",
+ "parameters":[
+ {
+ "Name":"orderKey",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"The orderKey for the order (provided in the OrderKey field returned by the /dealpurchase/start API call"
+ },
+ {
+ "Name":"creditCardNumber",
+ "Required":"N",
+ "Default":"",
+ "Type":"string",
+ "Description":"The credit card account number"
+ },
+ {
+ "Name":"creditCardExpiresMonth",
+ "Required":"N",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[1,2,3,4,5,6,7,8,9,10,11,12],
+ "Description":"The expiration month (1-12)"
+ },
+ {
+ "Name":"creditCardExpiresYear",
+ "Required":"N",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030],
+ "Description":"The expiration year (4 digits)"
+ },
+ {
+ "Name":"creditCardNameOnCard",
+ "Required":"N",
+ "Default":"",
+ "Type":"string",
+ "Description":"The exact full name on the credit card account"
+ },
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ },
+ {
+ "MethodName":"/dealpurchase/setbillingaddress",
+ "Synopsis":"Change or add the provided billing address for use in the purchase.",
+ "HTTPMethod":"POST",
+ "URI":"/dealpurchase/setbillingaddress",
+ "parameters":[
+ {
+ "Name":"orderKey",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"The orderKey for the order (provided in the OrderKey field returned by the /dealpurchase/start API call"
+ },
+ {
+ "Name":"streetAddress",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"The Street Address"
+ },
+ {
+ "Name":"city",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"City"
+ },
+ {
+ "Name":"state",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"State/Province code"
+ },
+ {
+ "Name":"postalCode",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"The Postal/ZIP Code"
+ },
+ {
+ "Name":"countryCode",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"The 3-digit country code (USA, CAN, etc.) - see http://en.wikipedia.org/wiki/ISO_3166-1_alpha-3"
+ },
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ },
+ {
+ "MethodName":"/dealpurchase/placeorder",
+ "Synopsis":"The user places an order",
+ "HTTPMethod":"POST",
+ "URI":"/dealpurchase/placeorder",
+ "parameters":[
+ {
+ "Name":"orderKey",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"The orderKey for the order (provided in the OrderKey field returned by the /dealpurchase/start API call)"
+ },
+ {
+ "Name":"payerID",
+ "Required":"N",
+ "Default":"",
+ "Type":"string",
+ "Description":"The payerID returned in PayPal redirect URL required if the user chooses 'PayPal' payment method"
+ },
+ {
+ "Name":"creditCardValidationCode",
+ "Required":"N",
+ "Default":"",
+ "Type":"string",
+ "Description":"The credit card validation code."
+ },
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ },
+ {
+ "MethodName":"/dealpurchase/setpaypalpaymentinfo",
+ "Synopsis":"Set the PayPal payment instructions for use in the purchase.",
+ "HTTPMethod":"POST",
+ "URI":"/dealpurchase/setpaypalpaymentinfo",
+ "parameters":[
+ {
+ "Name":"orderKey",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"The orderKey for the order (provided in the OrderKey field returned by the /dealpurchase/start API call)"
+ },
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ },
+ {
+ "MethodName":"/dealpurchase/setpaypalexpresscheckout",
+ "Synopsis":"Set the PayPal payment token and return URL and cancel URL.",
+ "HTTPMethod":"POST",
+ "URI":"/dealpurchase/setpaypalexpresscheckout",
+ "parameters":[
+ {
+ "Name":"orderKey",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"The orderKey for the order (provided in the OrderKey field returned by the /dealpurchase/start API call)"
+ },
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name":"Member",
+ "methods":[
+ {
+ "MethodName":"/dealorderhistory",
+ "Synopsis":"return a list of Storefront order line items",
+ "HTTPMethod":"GET",
+ "URI":"/member/dealorderhistory",
+ "parameters":[
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name":"Deals",
+ "methods":[
+ {
+ "MethodName":"/detail",
+ "Synopsis":"Get the details of a single deal",
+ "HTTPMethod":"GET",
+ "URI":"/deal/detail",
+ "parameters":[
+ {
+ "Name":"dealId",
+ "Required":"Y",
+ "Default":"",
+ "Type":"int",
+ "Description":"The ID of the initial deal item to be added to the order"
+ },
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ },
+ {
+ "MethodName":"/LocalDeals",
+ "Synopsis":"Get local deals by market zone id",
+ "HTTPMethod":"GET",
+ "URI":"/deal/localdeals",
+ "parameters":[
+ {
+ "Name":"MarketZoneId",
+ "Required":"N",
+ "Default":"",
+ "Type":"int",
+ "Description":"Market Zone Id. If not passed, use memeber's Market Zone Id instead."
+ },
+ {
+ "Name":"CategoryId",
+ "Required":"N",
+ "Default":"",
+ "Type":"int",
+ "Description":"Category Id"
+ },
+ {
+ "Name":"PriceMin",
+ "Required":"N",
+ "Default":"",
+ "Type":"int",
+ "Description":"The lowest price used to filter the deals"
+ },
+ {
+ "Name":"PriceMax",
+ "Required":"N",
+ "Default":"",
+ "Type":"int",
+ "Description":"The highest price used to filter the deals"
+ },
+ {
+ "Name":"SortBy",
+ "Required":"N",
+ "Default":"",
+ "Type":"Enumerator, possible values: Default,MostPurchased,EndingSoonest,RecentlyAdded,Discount,NumberOfReports,LowestPrice,HighestPrice,HighestGrade,Trending",
+ "Description":"Used to sort deals"
+ },
+ {
+ "Name":"PageSize",
+ "Required":"N",
+ "Default":"",
+ "Type":"int",
+ "Description":"The number of deals displayed per page."
+ },
+ {
+ "Name":"Page",
+ "Required":"N",
+ "Default":"",
+ "Type":"int",
+ "Description":"The current page number."
+ },
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
+
+
View
632 public/data/angieslist-local.json
@@ -0,0 +1,632 @@
+{
+ "endpoints":[
+ {
+ "name":"Authentication",
+ "methods":[
+ {
+ "MethodName":"/authentication",
+ "Synopsis":"Authenticates a user and returns a temporary Auth Token",
+ "HTTPMethod":"GET",
+ "URI":"/authentication",
+ "parameters":[
+ {
+ "Name":"email",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"User email"
+ },
+ {
+ "Name":"password",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":" "
+ },
+ {
+ "Name":"client_id",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"The secret client_id provided to the API consumer by Angie's List"
+ },
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ },
+ {
+ "MethodName":"/authentication/tokeninfo",
+ "Synopsis":"Returns status of an Auth Token",
+ "HTTPMethod":"GET",
+ "URI":"/authentication/tokeninfo",
+ "parameters":[
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name":"Service Providers",
+ "methods":[
+ {
+ "MethodName":"/serviceprovider/search",
+ "Synopsis":"Search for Service Providers",
+ "HTTPMethod":"GET",
+ "URI":"/serviceprovider/search",
+ "parameters":[
+ {
+ "Name":"query",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"The search term(s) (or if searchtype is category the categoryId)"
+ },
+ {
+ "Name":"searchtype",
+ "Required":"N",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":["keyword","category","name"],
+ "Description":"The type of search to perform. Keyword searches against a text index. Name is targeted at just the name of the company. Category expects the query param to be the numeric categoryId of a specific category. If blank, we attempt to guess the user's intent."
+ },
+ {
+ "Name":"sortby",
+ "Required":"N",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":["CouponsFirst","GradesAToF","ReportsMaxToMin","MilesToHomeMinToMax","CompanyNameAToZ"],
+ "Description":"The order in which to return the search results. If blank it will default to CouponsFirst sort order."
+ },
+ {
+ "Name":"listtype",
+ "Required":"N",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":["Classic","Health","ClassicCar"],
+ "Description":"The specific list to search in. If blank, it will return results in the one with the most relevent results"
+ },
+ {
+ "Name":"pageSize",
+ "Required":"N",
+ "Default":"10",
+ "Type":"enumerated",
+ "EnumeratedList":[5,10,15,20,50],
+ "Description":"Number of records to return per page"
+ },
+ {
+ "Name":"page",
+ "Required":"N",
+ "Default":"0",
+ "Type":"int",
+ "Description":"Page index to retrieve (0 is the first page)"
+ },
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ },
+ {
+ "MethodName":"/serviceprovider/detail",
+ "Synopsis":"Details of a single Service Provider",
+ "HTTPMethod":"GET",
+ "URI":"/serviceprovider/detail",
+ "parameters":[
+ {
+ "Name":"serviceProviderId",
+ "Required":"Y",
+ "Default":"",
+ "Type":"int",
+ "Description":"The Service Provider ID"
+ },
+ {
+ "Name":"categoryId",
+ "Required":"N",
+ "Default":"",
+ "Type":"int",
+ "Description":"The Category ID to use to provide context for the details. If blank the data will be provided in context of a server determined 'default' category"
+ },
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ },
+ {
+ "MethodName":"/serviceprovider/reports",
+ "Synopsis":"List of reports for a Service Provider in a particular Category",
+ "HTTPMethod":"GET",
+ "URI":"/serviceprovider/reports",
+ "parameters":[
+ {
+ "Name":"serviceProviderId",
+ "Required":"Y",
+ "Default":"",
+ "Type":"int",
+ "Description":"The Service Provider ID"
+ },
+ {
+ "Name":"categoryId",
+ "Required":"Y",
+ "Default":"",
+ "Type":"int",
+ "Description":"The Category ID to use to provide context for the details. If blank the data will be provided in context of a server determined 'default' category"
+ },
+ {
+ "Name":"pageSize",
+ "Required":"N",
+ "Default":"10",
+ "Type":"enumerated",
+ "EnumeratedList":[5,10,15,20,50],
+ "Description":"Number of records to return per page"
+ },
+ {
+ "Name":"page",
+ "Required":"N",
+ "Default":"0",
+ "Type":"int",
+ "Description":"Page index to retrieve (0 is the first page)"
+ },
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name":"Deal Purchases",
+ "methods":[
+ {
+ "MethodName":"/dealpurchase/start",
+ "Synopsis":"Sets up an order for purchase of a deal item and returns the details for confirmation by the user.",
+ "HTTPMethod":"GET",
+ "URI":"/dealpurchase/start",
+ "parameters":[
+ {
+ "Name":"dealId",
+ "Required":"Y",
+ "Default":"",
+ "Type":"int",
+ "Description":"The ID of the initial deal item to be added to the order"
+ },
+ {
+ "Name":"quantity",
+ "Required":"N",
+ "Default":"1",
+ "Type":"int",
+ "Description":"The quantity of initial deal item to be added to the order"
+ },
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ },
+ {
+ "MethodName":"/dealpurchase/setpaymentinfo",
+ "Synopsis":"Change or add the provided payment instructions for use in the purchase. If the paymentType is CreditCard then all the 'creditCard*' params are required, otherwise if PayPal is used those params can be left blank.",
+ "HTTPMethod":"POST",
+ "URI":"/dealpurchase/setpaymentinfo",
+ "parameters":[
+ {
+ "Name":"orderKey",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"The orderKey for the order (provided in the OrderKey field returned by the /dealpurchase/start API call"
+ },
+ {
+ "Name":"paymentType",
+ "Required":"Y",
+ "Default":"CreditCard",
+ "Type":"enumerated",
+ "EnumeratedList":["CreditCard","PayPal"],
+ "Description":"The type of payment to use"
+ },
+ {
+ "Name":"creditCardNumber",
+ "Required":"N",
+ "Default":"",
+ "Type":"string",
+ "Description":"The credit card account number"
+ },
+ {
+ "Name":"creditCardExpiresMonth",
+ "Required":"N",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[1,2,3,4,5,6,7,8,9,10,11,12],
+ "Description":"The expiration month (1-12)"
+ },
+ {
+ "Name":"creditCardExpiresYear",
+ "Required":"N",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030],
+ "Description":"The expiration year (4 digits)"
+ },
+ {
+ "Name":"creditCardNameOnCard",
+ "Required":"N",
+ "Default":"",
+ "Type":"string",
+ "Description":"The exact full name on the credit card account"
+ },
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ },
+ {
+ "MethodName":"/dealpurchase/setbillingaddress",
+ "Synopsis":"Change or add the provided billing address for use in the purchase.",
+ "HTTPMethod":"POST",
+ "URI":"/dealpurchase/setbillingaddress",
+ "parameters":[
+ {
+ "Name":"orderKey",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"The orderKey for the order (provided in the OrderKey field returned by the /dealpurchase/start API call"
+ },
+ {
+ "Name":"streetAddress",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"The Street Address"
+ },
+ {
+ "Name":"city",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"City"
+ },
+ {
+ "Name":"state",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"State/Province code"
+ },
+ {
+ "Name":"postalCode",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"The Postal/ZIP Code"
+ },
+ {
+ "Name":"countryCode",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"The 3-digit country code (USA, CAN, etc.) - see http://en.wikipedia.org/wiki/ISO_3166-1_alpha-3"
+ },
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ },
+ {
+ "MethodName":"/dealpurchase/placeorder",
+ "Synopsis":"The user places an order",
+ "HTTPMethod":"POST",
+ "URI":"/dealpurchase/placeorder",
+ "parameters":[
+ {
+ "Name":"orderKey",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"The orderKey for the order (provided in the OrderKey field returned by the /dealpurchase/start API call)"
+ },
+ {
+ "Name":"payPalToken",
+ "Required":"N",
+ "Default":"",
+ "Type":"string",
+ "Description":"The PayPal token required if the user chooses 'PayPal' payment method (provided in the Token field returned by the /payment/SetPayPalExpressCheckout API call"
+ },
+ {
+ "Name":"payerID",
+ "Required":"N",
+ "Default":"",
+ "Type":"string",
+ "Description":"The payerID returned in PayPal redirect URL required if the user chooses 'PayPal' payment method"
+ },
+ {
+ "Name":"creditCardValidationCode",
+ "Required":"N",
+ "Default":"",
+ "Type":"string",
+ "Description":"The credit card validation code."
+ },
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ },
+ {
+ "MethodName":"/dealpurchase/setpaypalexpresscheckout",
+ "Synopsis":"Initialize PayPal Express checkout",
+ "HTTPMethod":"POST",
+ "URI":"/dealpurchase/setpaypalexpresscheckout",
+ "parameters":[
+ {
+ "Name":"orderKey",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"The orderKey for the order (provided in the OrderKey field returned by the /dealpurchase/start API call)"
+ },
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name":"Member",
+ "methods":[
+ {
+ "MethodName":"/dealorderhistory",
+ "Synopsis":"return a list of Storefront order line items",
+ "HTTPMethod":"GET",
+ "URI":"/member/dealorderhistory",
+ "parameters":[
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name":"Deals",
+ "methods":[
+ {
+ "MethodName":"/detail",
+ "Synopsis":"Get the details of a single deal",
+ "HTTPMethod":"GET",
+ "URI":"/deal/detail",
+ "parameters":[
+ {
+ "Name":"dealId",
+ "Required":"Y",
+ "Default":"",
+ "Type":"int",
+ "Description":"The ID of the initial deal item to be added to the order"
+ },
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ },
+ {
+ "MethodName":"/LocalDeals",
+ "Synopsis":"Get local deals by market zone id",
+ "HTTPMethod":"GET",
+ "URI":"/deal/localdeals",
+ "parameters":[
+ {
+ "Name":"MarketZoneId",
+ "Required":"N",
+ "Default":"",
+ "Type":"int",
+ "Description":"Market Zone Id. If not passed, use memeber's Market Zone Id instead."
+ },
+ {
+ "Name":"CategoryId",
+ "Required":"N",
+ "Default":"",
+ "Type":"int",
+ "Description":"Category Id"
+ },
+ {
+ "Name":"PriceMin",
+ "Required":"N",
+ "Default":"",
+ "Type":"int",
+ "Description":"The lowest price used to filter the deals"
+ },
+ {
+ "Name":"PriceMax",
+ "Required":"N",
+ "Default":"",
+ "Type":"int",
+ "Description":"The highest price used to filter the deals"
+ },
+ {
+ "Name":"SortBy",
+ "Required":"N",
+ "Default":"",
+ "Type":"Enumerator, possible values: Default,MostPurchased,EndingSoonest,RecentlyAdded,Discount,NumberOfReports,LowestPrice,HighestPrice,HighestGrade,Trending",
+ "Description":"Used to sort deals"
+ },
+ {
+ "Name":"PageSize",
+ "Required":"N",
+ "Default":"",
+ "Type":"int",
+ "Description":"The number of deals displayed per page."
+ },
+ {
+ "Name":"Page",
+ "Required":"N",
+ "Default":"",
+ "Type":"int",
+ "Description":"The current page number."
+ },
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
+
+
View
611 public/data/angieslist.json
@@ -0,0 +1,611 @@
+{
+ "endpoints":[
+ {
+ "name":"Authentication",
+ "methods":[
+ {
+ "MethodName":"/authentication",
+ "Synopsis":"Authenticates a user and returns a temporary Auth Token",
+ "HTTPMethod":"GET",
+ "URI":"/authentication",
+ "parameters":[
+ {
+ "Name":"email",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"User email"
+ },
+ {
+ "Name":"password",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":" "
+ },
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ },
+ {
+ "MethodName":"/authentication/tokeninfo",
+ "Synopsis":"Returns status of an Auth Token",
+ "HTTPMethod":"GET",
+ "URI":"/authentication/tokeninfo",
+ "parameters":[
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name":"Service Providers",
+ "methods":[
+ {
+ "MethodName":"/serviceprovider/search",
+ "Synopsis":"Search for Service Providers",
+ "HTTPMethod":"GET",
+ "URI":"/serviceprovider/search",
+ "parameters":[
+ {
+ "Name":"query",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"The search term(s) (or if searchtype is category the categoryId)"
+ },
+ {
+ "Name":"searchtype",
+ "Required":"N",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":["keyword","category","name"],
+ "Description":"The type of search to perform. Keyword searches against a text index. Name is targeted at just the name of the company. Category expects the query param to be the numeric categoryId of a specific category. If blank, we attempt to guess the user's intent."
+ },
+ {
+ "Name":"sortby",
+ "Required":"N",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":["CouponsFirst","GradesAToF","ReportsMaxToMin","MilesToHomeMinToMax","CompanyNameAToZ"],
+ "Description":"The order in which to return the search results. If blank it will default to CouponsFirst sort order."
+ },
+ {
+ "Name":"listtype",
+ "Required":"N",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":["Classic","Health","ClassicCar"],
+ "Description":"The specific list to search in. If blank, it will return results in the one with the most relevent results"
+ },
+ {
+ "Name":"pageSize",
+ "Required":"N",
+ "Default":"10",
+ "Type":"enumerated",
+ "EnumeratedList":[5,10,15,20,50],
+ "Description":"Number of records to return per page"
+ },
+ {
+ "Name":"page",
+ "Required":"N",
+ "Default":"0",
+ "Type":"int",
+ "Description":"Page index to retrieve (0 is the first page)"
+ },
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ },
+ {
+ "MethodName":"/serviceprovider/detail",
+ "Synopsis":"Details of a single Service Provider",
+ "HTTPMethod":"GET",
+ "URI":"/serviceprovider/detail",
+ "parameters":[
+ {
+ "Name":"serviceProviderId",
+ "Required":"Y",
+ "Default":"",
+ "Type":"int",
+ "Description":"The Service Provider ID"
+ },
+ {
+ "Name":"categoryId",
+ "Required":"N",
+ "Default":"",
+ "Type":"int",
+ "Description":"The Category ID to use to provide context for the details. If blank the data will be provided in context of a server determined 'default' category"
+ },
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ },
+ {
+ "MethodName":"/serviceprovider/reports",
+ "Synopsis":"List of reports for a Service Provider in a particular Category",
+ "HTTPMethod":"GET",
+ "URI":"/serviceprovider/reports",
+ "parameters":[
+ {
+ "Name":"serviceProviderId",
+ "Required":"Y",
+ "Default":"",
+ "Type":"int",
+ "Description":"The Service Provider ID"
+ },
+ {
+ "Name":"categoryId",
+ "Required":"Y",
+ "Default":"",
+ "Type":"int",
+ "Description":"The Category ID to use to provide context for the details. If blank the data will be provided in context of a server determined 'default' category"
+ },
+ {
+ "Name":"pageSize",
+ "Required":"N",
+ "Default":"10",
+ "Type":"enumerated",
+ "EnumeratedList":[5,10,15,20,50],
+ "Description":"Number of records to return per page"
+ },
+ {
+ "Name":"page",
+ "Required":"N",
+ "Default":"0",
+ "Type":"int",
+ "Description":"Page index to retrieve (0 is the first page)"
+ },
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name":"Deal Purchases",
+ "methods":[
+ {
+ "MethodName":"/dealpurchase/start",
+ "Synopsis":"Sets up an order for purchase of a deal item and returns the details for confirmation by the user.",
+ "HTTPMethod":"GET",
+ "URI":"/dealpurchase/start",
+ "parameters":[
+ {
+ "Name":"dealId",
+ "Required":"Y",
+ "Default":"",
+ "Type":"int",
+ "Description":"The ID of the initial deal item to be added to the order"
+ },
+ {
+ "Name":"quantity",
+ "Required":"N",
+ "Default":"1",
+ "Type":"int",
+ "Description":"The quantity of initial deal item to be added to the order"
+ },
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ },
+ {
+ "MethodName":"/dealpurchase/setpaymentinfo",
+ "Synopsis":"Change or add the provided payment instructions for use in the purchase. If the paymentType is CreditCard then all the 'creditCard*' params are required, otherwise if PayPal is used those params can be left blank.",
+ "HTTPMethod":"POST",
+ "URI":"/dealpurchase/setpaymentinfo",
+ "parameters":[
+ {
+ "Name":"orderKey",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"The orderKey for the order (provided in the OrderKey field returned by the /dealpurchase/start API call"
+ },
+ {
+ "Name":"paymentType",
+ "Required":"Y",
+ "Default":"CreditCard",
+ "Type":"enumerated",
+ "EnumeratedList":["CreditCard","PayPal"],
+ "Description":"The type of payment to use"
+ },
+ {
+ "Name":"creditCardNumber",
+ "Required":"N",
+ "Default":"",
+ "Type":"string",
+ "Description":"The credit card account number"
+ },
+ {
+ "Name":"creditCardExpiresMonth",
+ "Required":"N",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[1,2,3,4,5,6,7,8,9,10,11,12],
+ "Description":"The expiration month (1-12)"
+ },
+ {
+ "Name":"creditCardExpiresYear",
+ "Required":"N",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030],
+ "Description":"The expiration year (4 digits)"
+ },
+ {
+ "Name":"creditCardNameOnCard",
+ "Required":"N",
+ "Default":"",
+ "Type":"string",
+ "Description":"The exact full name on the credit card account"
+ },
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ },
+ {
+ "MethodName":"/dealpurchase/setbillingaddress",
+ "Synopsis":"Change or add the provided billing address for use in the purchase.",
+ "HTTPMethod":"POST",
+ "URI":"/dealpurchase/setbillingaddress",
+ "parameters":[
+ {
+ "Name":"orderKey",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"The orderKey for the order (provided in the OrderKey field returned by the /dealpurchase/start API call"
+ },
+ {
+ "Name":"streetAddress",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"The Street Address"
+ },
+ {
+ "Name":"city",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"City"
+ },
+ {
+ "Name":"state",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"State/Province code"
+ },
+ {
+ "Name":"postalCode",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"The Postal/ZIP Code"
+ },
+ {
+ "Name":"countryCode",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"The 3-digit country code (USA, CAN, etc.) - see http://en.wikipedia.org/wiki/ISO_3166-1_alpha-3"
+ },
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ },
+ {
+ "MethodName":"/dealpurchase/placeorder",
+ "Synopsis":"The user places an order",
+ "HTTPMethod":"POST",
+ "URI":"/dealpurchase/placeorder",
+ "parameters":[
+ {
+ "Name":"orderKey",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"The orderKey for the order (provided in the OrderKey field returned by the /dealpurchase/start API call)"
+ },
+ {
+ "Name":"payPalToken",
+ "Required":"N",
+ "Default":"",
+ "Type":"string",
+ "Description":"The PayPal token required if the user chooses 'PayPal' payment method (provided in the Token field returned by the /payment/SetPayPalExpressCheckout API call"
+ },
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ },
+ {
+ "MethodName":"/dealpurchase/setpaypalexpresscheckout",
+ "Synopsis":"Initialize PayPal Express checkout",
+ "HTTPMethod":"POST",
+ "URI":"/dealpurchase/setpaypalexpresscheckout",
+ "parameters":[
+ {
+ "Name":"orderKey",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"The orderKey for the order (provided in the OrderKey field returned by the /dealpurchase/start API call)"
+ },
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name":"Member",
+ "methods":[
+ {
+ "MethodName":"/dealorderhistory",
+ "Synopsis":"return a list of Storefront order line items",
+ "HTTPMethod":"GET",
+ "URI":"/member/dealorderhistory",
+ "parameters":[
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name":"Deals",
+ "methods":[
+ {
+ "MethodName":"/detail",
+ "Synopsis":"Get the details of a single deal",
+ "HTTPMethod":"GET",
+ "URI":"/deal/detail",
+ "parameters":[
+ {
+ "Name":"dealId",
+ "Required":"Y",
+ "Default":"",
+ "Type":"int",
+ "Description":"The ID of the initial deal item to be added to the order"
+ },
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ },
+ {
+ "MethodName":"/LocalDeals",
+ "Synopsis":"Get local deals by market zone id",
+ "HTTPMethod":"GET",
+ "URI":"/deal/localdeals",
+ "parameters":[
+ {
+ "Name":"MarketZoneId",
+ "Required":"N",
+ "Default":"",
+ "Type":"int",
+ "Description":"Market Zone Id. If not passed, use memeber's Market Zone Id instead."
+ },
+ {
+ "Name":"CategoryId",
+ "Required":"N",
+ "Default":"",
+ "Type":"int",
+ "Description":"Category Id"
+ },
+ {
+ "Name":"PriceMin",
+ "Required":"N",
+ "Default":"",
+ "Type":"int",
+ "Description":"The lowest price used to filter the deals"
+ },
+ {
+ "Name":"PriceMax",
+ "Required":"N",
+ "Default":"",
+ "Type":"int",
+ "Description":"The highest price used to filter the deals"
+ },
+ {
+ "Name":"SortBy",
+ "Required":"N",
+ "Default":"",
+ "Type":"Enumerator, possible values: Default,MostPurchased,EndingSoonest,RecentlyAdded,Discount,NumberOfReports,LowestPrice,HighestPrice,HighestGrade,Trending",
+ "Description":"Used to sort deals"
+ },
+ {
+ "Name":"PageSize",
+ "Required":"N",
+ "Default":"",
+ "Type":"int",
+ "Description":"The number of deals displayed per page."
+ },
+ {
+ "Name":"Page",
+ "Required":"N",
+ "Default":"",
+ "Type":"int",
+ "Description":"The current page number."
+ },
+ {
+ "Name":"apiversion",
+ "Required":"Y",
+ "Default":"4",
+ "Type":"int",
+ "Description":"The API protocol version"
+ },
+ {
+ "Name":"sourcekey",
+ "Required":"Y",
+ "Default":"iphone",
+ "Type":"enumerated",
+ "EnumeratedList":["iphone","android","ipad","www"],
+ "Description":"A hint at the source of the request"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
+
+
View
65 public/data/apiconfig.json
@@ -1,55 +1,26 @@
{
- "klout": {
- "name": "Klout API",
- "protocol": "http",
- "baseURL": "api.klout.com",
- "publicPath": "/1",
- "auth": "key",
- "keyParam": "key"
- },
- "fanfeedr": {
- "name": "FanFeedr Sports Basic API",
- "protocol": "http",
- "baseURL": "ffapi.fanfeedr.com",
+ "angieslist": {
+ "name": "Angie's List API",
+ "protocol": "https",
+ "baseURL": "qaapi.angieslist.com",
"publicPath": "",
"auth": "key",
- "keyParam": "api_key"
- },
- "usatoday": {
- "name": "USA TODAY Census API",
- "protocol": "http",
- "baseURL": "api.usatoday.com",
- "publicPath": "/open",
- "auth": "key",
- "keyParam": "api_key"
+ "keyParam": "authorizationtoken"
},
- "linkedin": {
- "name": "LinkedIn",
- "protocol": "http",
- "baseURL": "api.linkedin.com",
+ "angieslist-dev" : {
+ "name":"Angie's List devapi.angieslist.com",
+ "protocol":"https",
+ "baseURL":"devapi.angieslist.com",
"publicPath": "",
- "privatePath": "/v1",
- "auth": "oauth",
- "oauth": {
- "type": "three-legged",
- "requestURL": "https://api.linkedin.com/uas/oauth/requestToken",
- "signinURL": "https://api.linkedin.com/uas/oauth/authorize?oauth_token=",
- "accessURL": "https://api.linkedin.com/uas/oauth/accessToken",
- "version": "1.0",
- "crypt": "HMAC-SHA1"
- },
- "keyParam":""
+ "auth": "key",
+ "keyParam": "authorizationtoken"
},
- "simplegeo": {
- "name": "SimpleGeo",
- "protocol": "http",
- "baseURL": "api.simplegeo.com",
- "publicPath": "",
- "auth": "oauth",
- "oauth": {
- "type": "two-legged",
- "version": "1.0",
- "crypt": "HMAC-SHA1"
- }
+ "angieslist-local" : {
+ "name":"Angie's List dev.angieslist.com/webapi",
+ "protocol":"https",
+ "baseURL":"dev.angieslist.com",
+ "publicPath": "/webapi",
+ "auth": "key",
+ "keyParam": "authorizationtoken"
}
}
View
19 public/data/test.js
@@ -0,0 +1,19 @@
+var https = require('https');
+
+var options = {
+ "host" : 'devapi.angieslist.com',
+ "method": 'GET',