Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
RESTful API with Grape
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Charles Lalonde
May 20, 2016
Programming
230
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
RESTful API with Grape
Charles Lalonde
May 20, 2016
Other Decks in Programming
See All in Programming
AI × TiDD / 2026.09.05 Redmine 大阪
tokudiro
1
120
Swift愛好会100回記念 第1回を振り返る
jollyjoester
0
120
コンパウンドプロダクト開発のためのローカルプロセスマネージャー再発明 #layerxgo
izumin5210
0
660
初心者DevRelとして参加者だった私が、DevRel Talks!#2に登壇するまでにしてきたこと
sokohirai
0
360
Swift愛好会と私(ウホーイ) / Swift Fan Club and Uhooi
uhooi
0
150
Deep dive into the select statement (GopherCon UK)
jespino
0
170
tsc.rip を支える技術 / Kyoto.なんか #8
susisu
0
4.4k
[GoCon2026] When Goroutines Are Not Enough: Runtime Locality in High-Throughput Go
takehaya
6
1.8k
巨大モノリシックアプリ モダン化大作戦
ktcryomm
0
610
Snowflakeで業務アプリを作ろう。 Snowflakeのアプリ機能解説&実践ガイド
ayumu_yamaguchi
1
220
まだ間に合う!今年の夏こそSchemeのマクロ展開器を完全理解!
omasanori
0
650
Kiroで創り、AgentCoreで繋ぐ!AWSで実践する「AI-DLC」から「AIエージェント統合」までの最新地図
licux
4
640
Featured
See All Featured
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.4k
How to train your dragon (web standard)
notwaldorf
97
6.8k
Amusing Abliteration
ianozsvald
1
290
Side Projects
sachag
456
43k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Git: the NoSQL Database
bkeepers
PRO
432
67k
Accessibility Awareness
sabderemane
1
210
Utilizing Notion as your number one productivity tool
mfonobong
4
580
How Software Deployment tools have changed in the past 20 years
geshan
1
34k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
660
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
570
How to make the Groovebox
asonas
2
2.4k
Transcript
RESTful API with Grape
Hi, I’m Charles Rails Developer @ Unsplash
Unsplash Do whatever you want high-resolution photos
None
None
None
None
None
None
Why Grape?
Why Grape? • Framework to build API • Easily extensible
• Supports Rails, Sinatra and others
Setup Rails in 4 simple steps
• app/ • api/ • v1/ • base.rb Create folder
structure Setup Rails in 4 simple steps
Setup Rails in 4 simple steps Auto load the API
files in your application.rb
Mount the API in routes.rb Setup Rails in 4 simple
steps
Setup Rails in 4 simple steps • Versioning • Format
• Endpoint mounting • Default headers • Logs
{ Grape } Basic
{ Grape } Basic • Call Overview • Headers •
Parameters • Http Methods • Error Handling • Helpers
Overview • Resource • Route params • HTTP methods •
Parameters GET api.montrealrb.com/v1/:resource/:route_param
Headers • Useful for bots • Alerting users of deprecated
endpoints • Allow multiple origins • etc
Parameters • Can manage optional and required params • Multiple
parameter types • Custom validation
HTTP methods • Supports all HTTP methods • Specify endpoint
names
Error handling • Message • Status
Helpers • Create reusable code • Can include custom modules
{ Grape } gem extension
{ Grape } gem extension WineBouncer Oauth2 protection with
Doorkeeper https://github.com/antek-drzewiecki/wine_bouncer grape-rails-cache Server side cache https://github.com/monterail/grape-rails-cache grape-swagger Automatically generate documentation https://github.com/ruby-grape/grape-swagger
{ Grape } gem extension
Demo
Unsplash API Stats API Requests 230 740 265 Last 30
days API Developers 2 479 Approved Applications 184
Connect @dechuck on Twitter, GitHub & Unsplash Thanks