Hello Guys,
Thanks for watching my videos. Please go through the API's below I have given for React Native News Application.
In this video series we are going learn so much things. If you are completing this series you will able do big projects by yourself.
Important Note: Make sure the API's is working by testing one of the below API's.
A) User Authentication API's
1) Register user
URL:
http://localhost:3000/api/users
Method:
POST
Body: Raw (JSON)
{
2) Login user
URL:
http://localhost:3000/api/users
Method:
POST
Request Headers: Bearer Token
x-access-token:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ODksImlhdCI6MTYwMjE2MTczMCwiZXhwIjoxNjAyMjQ4MTMwfQ.ZEs3cWhAh8htc5wSSR4UU8fUmWueSyE5cqQjaVP0MnU
Body: Raw (JSON)
{
3) Get logged in user using token
URL:
http://localhost:3000/api/users/profile
Method:
GET
Request Headers: Bearer Token
Authentication: Bearer Token
Body: Raw (JSON)
{
4) Add News To Favorite
URL:
http://localhost:3000/api/users/addToFav/605dc2e4c38f3712ea44af63
Method:
PUT
Request Headers: Bearer Token
Authentication: Bearer Token
5) Get Favorite News Of User
URL:
http://localhost:3000/api/users/getFavOfUser/all
Method:
GET
Request Headers: Bearer Token
6) Activate Register Token From Email
URL:
http://localhost:3000/api/users/active/6060221f2dcf780a43d515a0308deaf6e0fcdb356df9ec7462b46a3eac55527a
Method:
GET
B) News Category API's
1) Add Category
URL:
http://localhost:3000/api/category/addCategory
Method:
POST
Request Headers: Bearer Token
Authentication: Bearer Token
Body: Raw (JSON)
{
2) Get All Categories
URL:
http://localhost:3000/api/category/getAllCat
Method: GET
Request Headers: Bearer Token3) Update Category
URL: http://localhost:3000/api/category/editCategory/605caacf1cc71d0797978894
Method: PUT
Request Headers: Bearer Token Authentication: Bearer Token
Body: Raw (JSON)
{