#130 API CRUD endpoints
Create an API Controller where you can LIST, SHOW, CREATE, UPDATE, DESTROY records.
Episode source code: https://github.com/corsego/130-api-crud-endpoints/commit/de101248398714ec367cf3c4dfad7e95c8373d4f
Based on this blogpost: https://blog.corsego.com/rails-api-bearer-authentication
0:00 Recap of what we already have
2:00 scaffold Posts, belong to user
3:45 WTF Format JSON
5:05 WTF JBUILDER
6:08 cURL request to access posts
7:07 Access Posts controller within our API
11:42 API controller authorization - user can access only his own posts
13:30 fix ActiveRecord::RecordNotFound error
14:59 CREATE via API, fix InvalidAuthenticityToken
16:40 UPDATE via API. Importance of strong params
18:17 DESTROY via API
19:20 cleanup API controller
19:36 summary
0
Featured in playlists
![#126 API from Zero. Bearer authentication](https://superails.com/rails/active_storage/representations/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MTg5NCwicHVyIjoiYmxvYl9pZCJ9fQ==--d9ab90e263de74a6c1a4d424201854f86d43ebf7/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJqcGciLCJyZXNpemVfdG9fbGltaXQiOls0MDAsNjAwXX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--2d7cd3a4d9675c7f4c17dad7856d799792bd3595/maxresdefault.jpg)
![#127 cURL for CRUD API requests](https://superails.com/rails/active_storage/representations/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MTkwMywicHVyIjoiYmxvYl9pZCJ9fQ==--1bea179c61fcb2208e2ea8df4531d4f170cea74c/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJqcGciLCJyZXNpemVfdG9fbGltaXQiOls0MDAsNjAwXX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--2d7cd3a4d9675c7f4c17dad7856d799792bd3595/maxresdefault.jpg)
![#128 Faraday CRUD API requests. Communicate between two Rails apps!](https://superails.com/rails/active_storage/representations/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MTc2MSwicHVyIjoiYmxvYl9pZCJ9fQ==--4c84f0fbff8ecdac0f4a27620d6743053262adec/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJqcGciLCJyZXNpemVfdG9fbGltaXQiOls0MDAsNjAwXX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--2d7cd3a4d9675c7f4c17dad7856d799792bd3595/maxresdefault.jpg)
- Bearer token authentication
- create API endpoints
- Swagger
- OpenAPI
- rswag
- Usage tracking
- Rate limiting
& more!