Skip to content

Latest commit

 

History

History
539 lines (469 loc) · 9.59 KB

DOCUMENTATION.md

File metadata and controls

539 lines (469 loc) · 9.59 KB

Documentation

Books

Get Books - returns list of 66 bible books

Endpoint: GET https://www.abibliadigital.com.br/api/books

Authenticated:

  • No - Limit rate of 20 requests per hour
  • Yes - Unlimited
[
  {
    "abbrev": {"pt":"gn","en":"gn"},
    "author":"Moisés",
    "chapters":50,
    "group":"Pentateuco",
    "name":"Gênesis",
    "testament":"VT"
  },
  {
    "abbrev": {"pt":"ex","en":"ex"},
    "author":"Moisés",
    "chapters":40,
    "group":"Pentateuco",
    "name":"Êxodo",
    "testament":"VT"
  },
  ...
]
Get Book - return details of a bible book

Endpoint: GET https://www.abibliadigital.com.br/api/books/:abbrev

Authenticated:

  • No - Limit rate of 20 requests per hour
  • Yes - Unlimited
{
  "abbrev": {"pt":"mt","en":"mt"},
  "author":"Mateus",
  "chapters":28,
  "comment":"",
  "group":"Evangelhos",
  "name":"Mateus",
  "testament":"NT"
}

Verses

Get Chapter - returns all verses and details of a chapter

Endpoint: GET https://www.abibliadigital.com.br/api/verses/:version/:abbrev/:chapter

Authenticated:

  • No - Limit rate of 20 requests per hour
  • Yes - Unlimited
{
  "book": {
    "abbrev":{"pt":"gn","en":"gn"},
    "name":"Gênesis",
    "author":"Moisés",
    "group":"Pentateuco",
    "version":"nvi"
  },
  "chapter": {
    "number":1,
    "verses":31
  },
  "verses": [
    {"number": 1,"text":"No princípio Deus criou os céus e a terra."},
    {"number": 2,"text":"Era a terra sem forma e vazia; trevas cobriam a face do abismo, e o Espírito de Deus se movia sobre a face das águas."}
    ...
  ]
}
Get Verse - returns a verse from a chapter

Endpoint: GET https://www.abibliadigital.com.br/api/verses/:version/:abbrev/:chapter/:number

Authenticated:

  • No - Limit rate of 20 requests per hour
  • Yes - Unlimited
{
  "book": {
    "abbrev":{"pt":"gn","en":"gn"},
    "name":"Gênesis",
    "author":"Moisés",
    "group":"Pentateuco",
    "version":"nvi"
  },
  "chapter": 1,
  "number": 1,
  "text": "No princípio Deus criou os céus e a terra."
}
Get Random Verse - returns a random verse from a chapter

Endpoint: GET https://www.abibliadigital.com.br/api/verses/:version/random

Authenticated:

  • No - Limit rate of 20 requests per hour
  • Yes - Unlimited
{
  "book": {
    "abbrev":{"pt":"gn","en":"gn"},
    "name":"Gênesis",
    "author":"Moisés",
    "group":"Pentateuco",
    "version":"nvi"
  },
  "chapter": 1,
  "number": 1,
  "text": "No princípio Deus criou os céus e a terra."
}
Get Random Verse Book - return a verse from a specific book

Endpoint: GET https://www.abibliadigital.com.br/api/verses/:version/:abbrev/random

Authenticated:

  • No - Limit rate of 20 requests per hour
  • Yes - Unlimited
{
  "book": {
    "abbrev":{"pt":"gn","en":"gn"},
    "name":"Gênesis",
    "author":"Moisés",
    "group":"Pentateuco",
    "version":"nvi"
  },
  "chapter": 1,
  "number": 1,
  "text": "No princípio Deus criou os céus e a terra."
}
Search by word - returns verses with the searched word

Endpoint: POST https://www.abibliadigital.com.br/api/verses/search

Authenticated:

  • No - Limit rate of 20 requests per hour
  • Yes - Unlimited

Body:
{
  "version": "nvi",
  "search": "terra"
}

Response:
{
  "occurrence": 2102,
  "version": "nvi",
  "verses": [
    {
      "book": {
        "abbrev":{"pt":"gn","en":"gn"},
        "name":"Gênesis",
        "author": "Moisés",
        "chapters": 50,
        "group": "Pentateuco",
        "name": "Gênesis",
        "testament": "VT"
    },
    "chapter": 1,
    "number": 1,
    "text": "No princípio Deus criou os céus e a terra."
  },
  ...
}

Versions

Get Versions - returns all Bible versions and number of verses

Endpoint: GET https://www.abibliadigital.com.br/api/versions

Authenticated:

  • No - Limit rate of 20 requests per hour
  • Yes - Unlimited
[
  {
      "version": "acf",
      "verses": 31106
  },
  {
      "version": "apee",
      "verses": 30975
  },
  {
      "version": "bbe",
      "verses": 31104
  }
]

Users

The project will always be open source. Authentication is only to identify how many users are using the project and to inform about new updates.

Create User - create a new user

Endpoint: POST https://www.abibliadigital.com.br/api/users
Authenticated: No
Header:

  { 
    'Accept': 'application/json',
    'Content-Type': 'application/json'
  }

Body:

{
  "name": "Name",
  "email": "email@email.com",
  "password": "102030", // minimum size 6 digits
  "notifications": true // receive update emails from www.abibliadigital.com.br
}

Response:
{
  name: "Name",
  email: "email@email.com",
  token: "eyJhbGciOiJIU...", // does not expire
  notifications: true
}
Get User - returns a user

Endpoint: GET https://www.abibliadigital.com.br/api/users/:email
Authenticated: Yes
Header:

{ 
   Authorization: Bearer eyJhbGciOiJIU... 
}

Response:
{
  name: "Name",
  email: "email@email.com",
  token: "eyJhbGciOiJIU...", // does not expire
  notifications: true,
  lastLogin: "2020-01-01T16:59:22.862Z"
}
Get User Stats - returns user statistics

Endpoint: GET https://www.abibliadigital.com.br/api/users/stats
Authenticated: Yes
Header:

{ 
   Authorization: Bearer eyJhbGciOiJIU... 
}

Response:
{
  lastLogin: "2020-01-01T16:59:22.862Z",
  requestsPerMonth: [{
    range: '01/2020',
    total: 23
  },
  {
    range: '02/2020',
    total: 56
  }]
}
Update Token - returns a token

Endpoint: PUT https://www.abibliadigital.com.br/api/users/token
Authenticated: No
Body:

{
  "email": "email@email.com",
  "password": "102030",
}

Response:
{
  name: "Name",
  email: "email@email.com",
  token: "eyJhbGciOiJIU...", // does not expire
}
Delete User - remove user

Endpoint: DELETE https://www.abibliadigital.com.br/api/users
Authenticated: Yes
Header:

{ 
   Authorization: Bearer eyJhbGciOiJIU... 
}

Body:
{
  "email": "email@email.com",
  "password": "102030",
}

Response:
{
  msg: "User successfully removed",
}
Resend User Password - send email

Endpoint: POST https://www.abibliadigital.com.br/api/users/password/:email
Authenticated: No


Response:
{
  msg: "New password successfully sent to email :email"
}

Requests

Get Requests - All period requests

Endpoint: GET https://www.abibliadigital.com.br/api/requests/:range (month, week, day)
Authenticated: Yes
Response:

[
  {
      "url": "/api/verses/nvi/1co/9/8",
      "date": "2020-01-17T21:03:50.996Z"
  },
  {
      "url": "/api/books",
      "date": "2020-01-17T20:13:19.078Z"
  }
]
Get Number Requisitions - Number of requisitions for the period

Endpoint: GET https://www.abibliadigital.com.br/api/requests/amount/:range (month, week, day)
Authenticated: Yes
Response:

{
  "total": 3,
  "requests": [
    {
        "_id": "/api/books/",
        "count": 2
    },
    {
        "_id": "/api/verses/nvi/sl/23/",
        "count": 1
    }
]