project searches for articles in some Brazilian news sites;
designed for educational purposes. any copyright infringement, contact;
- G1
- R7
- EL PAIS BRAZIL
- Authorization
- Register
- Check if parameters are already registered
- Refresh Token
- User info
- Confirm email
- Get user info
- Re-send email confirmation
- News
- Wordpress
- Admin
- Contant
npm install
yarn install
curl --request POST \
--url http://localhost:8080/v1/auth \
--header 'Content-Type: application/json' \
--data '{
"password": "admin",
"username": "admin"
}'
curl --request POST \
--url http://localhost:8080/v1/register \
--header 'Content-Type: application/json' \
--data '{
"name": "name",
"lastname": "last",
"password": "admin",
"username": "admin",
"email": "mail@newstech.com",
"cell": "11900000000"
}'
username
curl --request GET \
--url http://localhost:8080/v1/register/user/{username} \
--header 'Content-Type: application/json'
curl --request GET \
--url http://localhost:8080/v1/register/email/{email} \
--header 'Content-Type: application/json'
cellphone
curl --request GET \
--url http://localhost:8080/v1/register/cellphone/{cellphone} \
--header 'Content-Type: application/json'
curl --request GET \
--url http://localhost:8080/v1/auth/refresh \
--header 'Authorization: Bearer {token}'
curl --request GET \
--url http://localhost:8080/v1/user \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json'
curl --request POST \
--url http://localhost:8080/v1/user/email/c \
--header 'Content-Type: application/json' \
--data '{
"code": "{code}"
"id": "{userId}
}'
curl --request GET \
--url http://localhost:8080/v1/auth/u/{username} \
--header 'Content-Type: application/json'
curl --request GET \
--url http://localhost:8080/v1/user/email/send \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json'
GET
curl --request GET \
--url 'http://localhost:8080/v1/api/news/list?{options}' \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json'
POST
curl --request POST \
--url 'http://localhost:8080/v1/api/news/list' \
--header 'Authorization: Bearer {token}'
--header 'Content-Type: application/json' \
--data '{options}'
SEARSH OPTIONS (* required)
- category: string (search for categories in endpoint)
- intitle: string (word search in title)
- limit: number | null
- source: "r7" | "g1" | "elpais" (comma separated for results from more than one source)
curl --request GET \
--url 'http://localhost:8080/v1/api/news/category?{options}' \
--header 'Authorization: Bearer {token}'
SEARSH OPTIONS (* required)
- source: "r7" | "g1" | "elpais" (comma separated for results from more than one source)
curl --request GET \
--url http://localhost:8080/v1/api/news/storage/add/{id_article} \
--header 'Authorization: Bearer {token}'
Article id is found in the result of article list endpoint
curl --request GET \
--url http://localhost:8080/v1/api/news/content/{id} \
--header 'Authorization: Bearer {token}'
**{id} found in storage response or article list response
curl --request POST \
--url http://localhost:8080/v1/api/wordpress/add/ \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data '{
"url": "{url}",
"username": "{username}",
"password": "{password}"
}'
OPTIONS (* required)
- *{url}: string (url wordpress system)
- *{username}: string (username using login in portal admin)
- *{password}: string (password using login in portal admin)
PLUGIN REQUIRED
- JWT AUTH
RECOMENDED: JWT Authentication for WP REST API
curl --request GET \
--url http://localhost:8080/v1/api/wordpress \
--header 'Authorization: Bearer {token}'
curl --request GET \
--url http://localhost:8080/v1/api/wordpress/get/category/{service_id} \
--header 'Authorization: Bearer {token}'
{service_id} found in list services
curl --request POST \
--url http://localhost:8080/v1/api/wordpress/add/category/{service_id} \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data '{
"name": string[],
"description": string[]
}'
{service_id} found in list services
curl --request GET \
--url http://localhost:8080/v1/api/wordpress/get/tags/{service_id} \
--header 'Authorization: Bearer {token}'
{service_id} found in list services
curl --request POST \
--url http://localhost:8080/v1/api/wordpress/add/tag/{service_id} \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data '{
"name": string[],
"description": string[]
}'
{service_id} found in list services
curl --request POST \
--url http://localhost:8080/v1/api/wordpress/add/media/{service_id} \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data '{
"description": {description},
"caption": "{caption}",
"url": "{url}",
"status": "{status}"
}'
OPTIONS (* required)
- *{url}: string (url image send wordpress)
- {description}: string (description image)
- {caption}: string (caption image)
- {status}: "publish" | "pending" (default: pending)
{service_id} found in list services {url} found in content
curl --request POST \
--url http://localhost:8080/v1/api/wordpress/add/post/{service_id} \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data '{
"status": "{status}",
"category": {category},
"id": "{id}",
"media_id": {media_id}
}'
OPTIONS (* required)
- {status}: "publish" | "future" | "pending" | "private" (default: pending)
- {password}: string (required if {status} is private)
- {category}: number[] (array categories id)
- *{id}: string (found in storage response or article list response)
- {media_id}: number (id featured image)
{service_id} found in list services
curl --request GET \
--url http://localhost:8080/v1/api/wordpress/job/{job_id} \
--header 'Authorization: Bearer {token}'
{job_id} found in response created post
curl --request GET \
--url http://localhost:8080/v1/api/wordpress/report/{service_id} \
--header 'Authorization: Bearer {token}'
{service_id} found in list services
curl --request GET \
--url http://localhost:8080/v1/api/wordpress/status \
--header 'Authorization: Bearer {token}'
list all user
curl --request GET \
--url http://localhost:8080/v1/admin/user/list \
--header 'Authorization: Bearer {token}'
user details
curl --request GET \
--url http://localhost:8080/v1/admin/user/{userId} \
--header 'Authorization: Bearer {token}'
add user
curl --request POST \
--url http://localhost:8080/v1/admin/user/add \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data '{
"name": "{name}",
"username": "{username}",
"password": "{password}",
"cell": "{cell}",
"email": "{email}",
"lastname": "{lastname}"
}'
block user
curl --request PUT \
--url http://localhost:8080/v1/admin/user/block \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data '{
"id": "{userId}"
}'
unlock user
curl --request PUT \
--url http://localhost:8080/v1/admin/user/unlock \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data '{
"id": "{userId}"
}'
edit user
curl --request PUT \
--url http://localhost:8080/v1/admin/user/edit \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data '{
"id": "{userId}",
"name": "{name}",
"lastname": "{lastname}",
"cellphone": "{cell}",
"email": "{email}",
}'
remove user
curl --request DELETE \
--url http://localhost:8080/v1/admin/user/remove \
--header 'Authorization: Bearer {userId}' \
--header 'Content-Type: application/json' \
--data '{
"id": "{userId}"
}'
list permission user
curl --request GET \
--url http://localhost:8080/v1/admin/acl/list/user/{userId} \
--header 'Authorization: Bearer {token}'
add permission user
curl --request POST \
--url http://localhost:8080/v1/admin/acl/add/user \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data '{
"user_id": "{userId}",
"permission_id": "{permissionId}"
}'
remove permission user
curl --request DELETE \
--url http://localhost:8080/v1/admin/acl/remove/user \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data '{
"user_id": "{userId}",
"permission_id": "{permissionId}"
}'
list permissions
curl --request GET \
--url http://localhost:8080/v1/admin/permission/list \
--header 'Authorization: Bearer {token}'
add permission
curl --request POST \
--url http://localhost:8080/v1/admin/permission/add \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data '{
"name": "{name}",
"description": "{description}"
}'