Upload
micha-mazaheri
View
209
Download
0
Embed Size (px)
Citation preview
Intro to dev tools for RESTful APIs
Micha Mazaheri
How to make a REST API?
How to test a REST API?
REST• Back to HTTP roots (RFC 2616) • Stateless – Each request is an independent transaction • Resources – Everything is a resource identified by a URI/{meetup_slug}/{meetup_slug}/events/{id}/{meetup_slug}/events/{id}/comments
• CRUD Methods GET, HEAD, OPTIONSPOST, PUT, PATCHDELETE
Stay RESTful
POST /ParisAPI/events/225897650/{ "name":"Paris API Rocks" }
PATCH /ParisAPI/events/225897650/{ "name":"Paris API Rocks"}
POST /ParisAPI/events/225897650/set-nameParis API Rocks
Hypermedia
{ "name":"Paris API", "organizer_id":88226292}
{ "name":"Paris API", “organizer":"/ParisAPI/members/88226292/"}
HATEOAS (Hypermedia as the Engine of Application State)
JSON Schemajson-schema.org
HTTP ClientsPlaygrounds for APIs
Paw
PawprintJSFiddle for APIs
Proxy
RunscopeTraffic InspectorCharles HTTP Client RequestBin
Local Tunneling
localhost:8080 api.mydomain.com
Secure tunnels to localhost
API definitionThink before writing code
Contract for APIs
Make consumers & providers happy together
Swagger• JSON or YAML • JSON Schema http://json-schema.org/
• Many integrations • Most popular (Github stars)
Swagger"paths": { "/meetups": { "get": { "description": "", "produces": [ "application/json" ], "parameters": [ { "name": "tags", "in": "query", "description": "Tag your devfloorists", "required": false, "type": "array", "items": { "type": "string" } ...
SwaggerSwagger UI for documentation
SwaggerSwagger Editor for realtime preview
RAML
API Blueprint
API BlueprintInteractive documentation (Apiary.io SaaS)
Monitoring Tools
Runscope Radar• Cloud proxy to debug
Debug staging & prod • Have assertions & tests
KONG & Galileo• KONG: extension of Nginx • Galileo: analytics for APIs
Oh and…We hire!Bring together API playgrounds & definitions
Encourage best practices
Collaboration platform
and cool customers already…
Stay Tuned
Oh and…We hire rockstars!
• React or OS X genius • Passion for interfaces &
beautiful code • Startup gal or guy (or cat?)
http.cathttps://http.cat
Thanks!
Micha Mazaheri
@mittsh
Paw http://paw.rest @luckymarmot
Questions?
Micha Mazaheri
@mittsh
Paw http://paw.rest @luckymarmot
50% off PARISAPI
Paw http://paw.rest @luckymarmot