Patrick Heneise
The guy standing and talking: Patrick Heneise, @PatrickHeneise
"Full Stack JavaScript Architect with a focus on mobile"
#nodejs #nosql #couchbase #couchdb #redis #elasticsearch #api #iphone #android #firefoxos #phonegap #cordova
Because I care about APIs.
Different types of authentication:
But OAuth2 is so complicated. Can I use ...
Implement OAuth2 right from the start, don't try to use anything else. You'll end up with it sooner or later anyway.*
* Until something else comes out.
Request: http://api.tumblr.com/v2/tagged?tag=gif
Response: { "meta":{ "status":200, "msg":"OK"}, "response":[] }
"\u003C\/p\u003E\n\u003Cp\u003ECopa del Rey\u00a0"
Never return nonsense.
curl -F 'client_id=CLIENT-ID' \
-F 'client_secret=CLIENT-SECRET' \
-F 'object=tag' \
-F 'aspect=media' \
-F 'object_id=nofilter' \
-F 'callback_url=http://YOUR-CALLBACK/URL' \
https://api.instagram.com/v1/subscriptions/
{
"subscription_id": "1",
"object": "user",
"object_id": "1234",
"changed_aspect": "media",
"time": 1297286541
}
Never return nonsense.
Request: https://stream.twitter.com/1.1/statuses/filter.json
Response: Full tweets
ZINCRBY 'api:requests:2010-07-10' 1 'users#update'
Increment a Sorted Set of daily “Controller#Action” values by User ID:
ZINCRBY 'api:requests:2010-06-30:users#update' 1 1337
Add the current date to a Set of dates for which we’re tracking data:
SADD api:requests:dates '2010-07-10'
Upload your Redis database and query with Amazon Redshift or Google BigQuery
Cheap, non-intrusive history without vendor lock-in.http://www.slideshare.net/supercoco9/api-analytics-with-redis-and-google-bigquery-nosql-matters-edition
Or: be smart, follow standards!
log(error, result);
null, ...
{ errors:
{ validationErrors: {},
errorCollections: { merchantAccount: [Object] } },
params:
{ merchantAccount:
{ applicantDetails: [Object],
tosAccepted: 'true',
masterMerchantAccountId: 'xx',
id: 'xx' },
action: 'create_via_api',
controller: 'merchant_accounts',
merchantId: 'xx' },
message: 'Master merchant account ID is invalid.',
success: false }
An invalid account ID isn't a serious error. https://github.com/braintree/braintree_node/issues/20#issuecomment-28726370
Get in touch!
@PatrickHeneise
themobilefirm.co
patrickheneise.com