API Documentations Of React Native News App

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)
                {
             "name""Ajit Pradhan",
             "email""ajitteaches@gmail.com",
             "password""Ajit@123"
        }

   2Login user

        URL: 
        http://localhost:3000/api/users

           Method: 
           POST
            
        Request Headers: Bearer Token
           x-access-token: 
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ODksImlhdCI6MTYwMjE2MTczMCwiZXhwIjoxNjAyMjQ4MTMwfQ.ZEs3cWhAh8htc5wSSR4UU8fUmWueSyE5cqQjaVP0MnU
    
            
           Body: Raw (JSON)
                {
             "email""ajitteaches@gmail.com",
             "password""Ajit@123"
        }  

  

 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)
                {
             "email""ajitteaches@gmail.com",
             "password""Ajit@123"
        }    


 4Add News To Favorite

        URL: 
        http://localhost:3000/api/users/addToFav/605dc2e4c38f3712ea44af63

           Method: 
           PUT
            
        Request Headers: Bearer Token
           Authentication: Bearer Token
    
       

 5Get Favorite News Of User

        URL: 
        http://localhost:3000/api/users/getFavOfUser/all

           Method: 
           GET
            
        Request Headers: Bearer Token
           Authentication: Bearer Token        

 6Activate 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)
                {
            "category_name""Science"
        }    

 2Get All Categories

     URL: 
     http://localhost:3000/api/category/getAllCat

     Method: 
     GET
            
        Request Headers: Bearer Token
     Authentication: Bearer Token  

3) Update Category

    URL: 
     http://localhost:3000/api/category/editCategory/605caacf1cc71d0797978894

     Method: 
      PUT
            
        Request Headers: Bearer Token
           Authentication: Bearer Token
    
            
           Body: Raw (JSON)
                {
            "category_name""Science"
        }  


4) Delete Category

        URL: 
        http://localhost:3000/api/category/deleteCategory/605ca18e8db74006417e551d

           Method: 
           DEL
            
        Request Headers: Bearer Token
           Authentication: Bearer Token

C) News API's

 1) Add News

        URL: 
        http://localhost:3000/api/news/addNews

           Method: 
           POST
            
        Request Headers: Bearer Token
           Authentication: Bearer Token
    
            
           Body: Raw (JSON)
                {
          "author""",
          "title""",
          "content""",
          "category""",
          "url""",
          "urlToImage"""
       }

 2Get All News

     URL: 
     http://localhost:3000/api/news/getAllNews/1/5

     Method: 
     GET

 3Get News By Id

     URL: 
     http://localhost:3000/api/news/getById/605dc2e4c38f3712ea44af63

     Method: 
     GET

 4Get News By Category Id

     URL: 
     http://localhost:3000/api/news/getByCategory/605caacf1cc71d0797978894/1/5

     Method: 
     GET

 5) Add News

        URL: 
        http://localhost:3000/api/news/editNews/605d41aac6810b04c5c2d61d

           Method: 
           PUT
            
        Request Headers: Bearer Token
           Authentication: Bearer Token
    
            
           Body: Raw (JSON)
                {
          "author""",
          "title""",
          "content""",
          "category""",
          "url""",
          "urlToImage"""
       }

6Get Slider News

     URL: 
     http://localhost:3000/api/news/getAllNews/slider

     Method: 
     GET

7Get Related News

     URL: 
     http://localhost:3000/api/news/getrelatedNews/605caacf1cc71d0797978894

     Method: 
     GET

8Get News within 24 hrs

     URL: 
     http://localhost:3000/api/news/getNews/by/today

     Method: 
     GET

C) Comment API's

 1) Add Comments on News

        URL: 
        http://localhost:3000/api/news/add/comment/onNews

           Method: 
           POST
            
        Request Headers: Bearer Token
           Authentication: Bearer Token
    
            
           Body: Raw (JSON)
              

    {
      "newsId""605dc2e4c38f3712ea44af63",
      "comment""Government should take strong actions."
    }


 2) Remove Comments on News

        URL: 
        http://localhost:3000/api/news/remove/comment/onNews

           Method: 
           DEL
            
        Request Headers: Bearer Token
           Authentication: Bearer Token
    
            
           Body: Raw (JSON)
              

   {

      "newsId""605dc2e4c38f3712ea44af63",
      "commentId""6069d73cb5d3840570a34a13"
   }



D) Slider API's

 1) Get Slider News

        URL: 
        http://localhost:3000/api/news/getAllNews/slider

           Method: 
           GET




All API's are mentioned. Kindly follow the tutorial to intergrate them. Thank you, Have a nice day.


Post a Comment (0)
Previous Post Next Post