Skip to content

Latest commit

 

History

History

api

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

NEWS API

This API project is written using Django Rest Framework.

MongoDB is the main database. Additionally, Elasticsearch serves as a query search engine.

Goal? Easily search for the latest news!

Open Endpoints

Open endpoints require no Authentication.

Endpoints that require Authentication

Closed endpoints require a valid Token to be included in the header of the request. A Token can be acquired from the User Login view above.

News related

Each endpoint displays News information:

Examples

  • see all news
http://127.0.0.1:5000/api/v1/news/ 
  • add search_fields title and description, see all of the news containing the Robert Lewandowski phrase
http://127.0.0.1:5000/api/v1/news/?search=Robert%20Lewandowski 
  • find news containing the Lewandowski phrase in their titles
http://127.0.0.1:5000/api/v1/news/?search=title|Lewandowski 
  • see all of the polish news containing the Lewandowski phrase
http://127.0.0.1:5000/api/v1/news/?search=lewandowski&language=pl

Endpoints for Admin User

Admin endpoints require an admin account and a valid Token included in the header of the request. A Token can be acquired from the User Login view above.

News related

Endpoints for News administration (MongoDB):

  • Admin news : GET/POST/DELETE/PATCH/PUT /admin/api/news/