To send authenticated request, add Authorization
header to the request with
Bearer {token}
value.
To get JSON
responses, add Accept
header with application/json
value.
All the URIs in this documentation has a prefix: /api/v1/
.
APIs That need methods (PUT
, PATCH
), it should sent as POST
request
and include the needed method as an extra parameter _method
.
- Responses
- Authentication
- Suwar
- Recitations
- Profiles
- Follow system
- Likes system
- Favorites system
- Comments
- Reports
- Assists APIs
Success response:
{
"success": true,
"message": "a text message"
}
Error response:
{
"success": false,
"message": "Error text message"
}
Validation error response:
{
"success": false,
"message": "Error text message",
"errors": {
"field-name": [ // array of errors messages
"Error text message"
]
}
}
- url:
login
- method:
POST
- parameters:
username
required // email or usernamepassword
required
- response: a
JSON
response like:
{
"success": true,
"message": "Login success message",
"user": {
"id": 1,
"name": "User Name",
"username": "username",
"email": "user@example.com",
"token": "Authentication token"
}
}
- url:
logout
- method:
GET
- Authentication required
- response: normal
Success response
.
- url:
register
- method:
POST
- parameters:
name
required // User full nameusername
requiredemail
requiredpassword
requiredpassword_confirmation
required
- response: normal
Success response
.
- url:
password/email
- method:
POST
- parameters:
email
required
- response: normal
Success response
.
- url:
social/{provider}
// available providers [facebook
] - method:
POST
- parameters:
oauth_token
required // The access_token returned from the provider
- response: a
JSON
response like:
{
"success": true,
"message": "Login success message",
"user": {
"id": 1,
"name": "User Name",
"username": "username",
"email": "user@example.com",
"token": "Authentication token"
}
}
- url:
/suwar
- method:
GET
- Authentication Required
- response: a
JSON
response with pagination like:
[ // arrau of models
{
"id": 1, // ID of sura
"name": "test", // name of sura
"revealed": "medinan",
"chronologicalOrder": 1
},
{
"id": 2,
"name": "Test 2",
"revealed": "medinan",
"chronologicalOrder": 3
}
]
- url:
/suwar/{model}
//{model}
is The ID of Sura - method:
GET
- Authentication Required
- response: a
JSON
response like:
{
"id": 1,
"name": "test",
"revealed": "labels.medinan",
"chronologicalOrder": 1,
"verses": [ // Array of verses
{
"id": 1, // ID of verse
"number": 1, // The number of verse
"text": "The text of verse",
"cleanText": "The clean text of verse",
"characters": "The characters of verse"
}
]
}
- url:
/recitations/list/{model?}
//{model}
is the userID
orusername
. if you leave it empty will return the recitations of logged in user. - method:
GET
- Authentication Required
- response: a
JSON
response with pagination like:
{
"total": 1, // total of user recitation
"limit": 15, // number of recitations per page
"currentPage": 1, // current page number
"data": [ // array of recitation
{
"id": 2, // ID of recitation
"slug": "xxxx",
"user": { // The owner of recitation
"id": 4,
"name": "AbdulKader",
"username": "abd",
"avatar": null,
"certified": false
},
"narration": { // Narration information
"id": 1,
"name": "Test",
"weight": 2
},
"fromVerse": { // Start verse
"id": 1,
"number": 1,
"text": "ssss",
"cleanText": "ssss",
"characters": "sss"
},
"toVerse": { // end Verse
"id": 2,
"number": 2,
"text": "dddd",
"cleanText": "dddd",
"characters": "dddd"
},
"date": 1476232607, // Created date
"commentsCount": 0, // number of comments
"favoritesCount": 0, // number of favorites
"likesCount": 0 // number of likes
}
]
}
- url:
/recitations/following
- method:
GET
- Authentication Required
- response: a
JSON
response pagination like:
{
"total": 1, // total of user recitation
"limit": 15, // number of recitations per page
"currentPage": 1, // current page number
"data": [ // array of recitation
{
"id": 2, // ID of recitation
"slug": "xxxx",
"user": { // The owner of recitation
"id": 4,
"name": "AbdulKader",
"username": "abd",
"avatar": null,
"certified": false
},
"narration": { // Narration information
"id": 1,
"name": "Test",
"weight": 2
},
"fromVerse": { // Start verse
"id": 1,
"number": 1,
"text": "ssss",
"cleanText": "ssss",
"characters": "sss"
},
"toVerse": { // end Verse
"id": 2,
"number": 2,
"text": "dddd",
"cleanText": "dddd",
"characters": "dddd"
},
"date": 1476232607, // Created date
"commentsCount": 0, // number of comments
"favoritesCount": 0, // number of favorites
"likesCount": 0 // number of likes
}
]
}
- url:
/recitations/latest
- method:
GET
- Authentication Required
- response: a
JSON
response pagination like:
{
"total": 1, // total of user recitation
"limit": 15, // number of recitations per page
"currentPage": 1, // current page number
"data": [ // array of recitation
{
"id": 2, // ID of recitation
"slug": "xxxx",
"user": { // The owner of recitation
"id": 4,
"name": "AbdulKader",
"username": "abd",
"avatar": null,
"certified": false
},
"narration": { // Narration information
"id": 1,
"name": "Test",
"weight": 2
},
"fromVerse": { // Start verse
"id": 1,
"number": 1,
"text": "ssss",
"cleanText": "ssss",
"characters": "sss"
},
"toVerse": { // end Verse
"id": 2,
"number": 2,
"text": "dddd",
"cleanText": "dddd",
"characters": "dddd"
},
"date": 1476232607, // Created date
"commentsCount": 0, // number of comments
"favoritesCount": 0, // number of favorites
"likesCount": 0 // number of likes
}
]
}
- url:
/recitations/popular
- method:
GET
- parameters:
sort
optional // can be [likes
|comments
|favorites
] default islikes
.
- Authentication Required
- response: a
JSON
response pagination like:
{
"total": 1, // total of user recitation
"limit": 15, // number of recitations per page
"currentPage": 1, // current page number
"data": [ // array of recitation
{
"id": 2, // ID of recitation
"slug": "xxxx",
"user": { // The owner of recitation
"id": 4,
"name": "AbdulKader",
"username": "abd",
"avatar": null,
"certified": false
},
"narration": { // Narration information
"id": 1,
"name": "Test",
"weight": 2
},
"fromVerse": { // Start verse
"id": 1,
"number": 1,
"text": "ssss",
"cleanText": "ssss",
"characters": "sss"
},
"toVerse": { // end Verse
"id": 2,
"number": 2,
"text": "dddd",
"cleanText": "dddd",
"characters": "dddd"
},
"date": 1476232607, // Created date
"commentsCount": 0, // number of comments
"favoritesCount": 0, // number of favorites
"likesCount": 0 // number of likes
}
]
}
- url:
/recitations
- method:
POST
- Authentication required
- parameters:
sura_id
required // The ID of recited Suranarration_id
required // The ID of recite's narrationfrom_verse
required // ID of start verseto_verse
required // ID of end versefile
required // file of recitationdescription
optional // The comment on the recitationmentions
optional // should be array of users IDs That mentioned in the post
- response: normal
Success response
.
- url:
/recitations/{model}
//{model}
is theID
of recitation - method:
POST
- Authentication required
- parameters:
sura_id
required // The ID of recited Suranarration_id
required // The ID of recite's narrationfrom_verse
required // ID of start verseto_verse
required // ID of end versedescription
optional // The comment on the recitationmentions
optional // should be array of users IDs That mentioned in the post
- response: normal
Success response
.
- url:
/recitations/{model}
//{model}
is theID
of recitation - method:
Delete
- Authentication required
- response: normal
Success response
.
This end point increase the number of listeners of recitation.
- url:
/recitations/{model}/listen
//{model}
is theID
of recitation - method:
POST
- response: normal
Success response
.
- url:
/recitations/{model}
//{model}
is The ID of Recitation - method:
GET
- Authentication required
- response: a
JSON
response like:
{
"id": 2,
"slug": "xxxx",
"user": { // Owner information
"id": 4,
"name": "AbdulKader",
"username": "abd",
"avatar": null,
"certified": false
},
"narration": { // Narration information
"id": 1,
"name": "Test",
"weight": 2
},
"fromVerse": { // Start verse information
"id": 1,
"number": 1,
"text": "ssss",
"cleanText": "ssss",
"characters": "sss"
},
"toVerse": { // end verse information
"id": 2,
"number": 2,
"text": "dddd",
"cleanText": "dddd",
"characters": "dddd"
},
"date": 1476232607, // Created date timestamp
"verified": false,
"commentsCount": 0,
"favoritesCount": 0,
"likesCount": 0,
"listenersCount": 0,
"description": "xxxxx",
"url": "xxxx",
"sura": { // Sura information
"id": 1,
"name": "test",
"verseCount": 2,
"revealed": "labels.medinan",
"chronologicalOrder": 1
},
"mentions": [], // Array of Mentioned users
"verses": [ // Array of recited verses
{
"id": 1,
"number": 1,
"text": "ssss",
"cleanText": "ssss",
"characters": "sss"
},
{
"id": 2,
"number": 2,
"text": "dddd",
"cleanText": "dddd",
"characters": "dddd"
}
]
}
- url:
/recitations/search
- method:
POST
- parameters:
keyword
required // minimum 2 characterssura_id
optional // could be anarray
orstring
with commas between Suwar IDsnarration_is
optional // could be anarray
orstring
with commas between narrations IDs
- Authentication Required
- response: a
JSON
response pagination like:
{
"total": 1, // total of user recitation
"limit": 15, // number of recitations per page
"currentPage": 1, // current page number
"data": [ // array of recitation
{
"id": 2, // ID of recitation
"slug": "xxxx",
"user": { // The owner of recitation
"id": 4,
"name": "AbdulKader",
"username": "abd",
"avatar": null,
"certified": false
},
"narration": { // Narration information
"id": 1,
"name": "Test",
"weight": 2
},
"fromVerse": { // Start verse
"id": 1,
"number": 1,
"text": "ssss",
"cleanText": "ssss",
"characters": "sss"
},
"toVerse": { // end Verse
"id": 2,
"number": 2,
"text": "dddd",
"cleanText": "dddd",
"characters": "dddd"
},
"date": 1476232607, // Created date
"commentsCount": 0, // number of comments
"favoritesCount": 0, // number of favorites
"likesCount": 0 // number of likes
}
]
}
- url:
/profiles
- method:
POST
- parameters:
name
required // maximum 255 charactersimage
optional // profile image filebio
optional // Maximum 500 characterslanguage_key
optional // should be a key exists in languages databasecountry
optional // should be a key exists in countries databasecity
optionalgender
optional // available values: [male
|female
]email_notification
optional // booleanprivate
optional // boolean
- Authentication Required
- response: normal
Success response
.
- url:
/profiles/{model}/avatar
//{model}
is theusername
orID
of logged in user - method:
POST
- parameters:
image
required // image file
- Authentication Required
- response: normal
Success response
.
- url:
/profiles/{model}/avatar
//{model}
is theusername
orID
of logged in user - method:
DELETE
- Authentication Required
- response: normal
Success response
.
- url:
/profiles/{model?}
//{model}
is theuser ID
orusername
. if you leave it empty will return the profile of logged in user. - method:
GET
- Authentication Required
- response: a
JSON
response like:
{
"id": 4,
"name": "AbdulKader Zein Eddin",
"username": "abd",
"avatar": "http://rattil.app/public/profiles/a87ff679a2f3e71d9181a67b7542122c.jpg",
"bio": "Bio text",
"language_key": "en",
"country": "SA",
"city": "Al Riyad",
"gender": "male",
"email_notification": 1, // This variable will return only if the profile is for logged in user
"private": 0, // This variable will return only if the profile is for logged in user
"followed": 0, // 0 = Not followed, 2 = Pending acceptance, 1 = followed
"followers_count": 0,
"following_count": 0,
"favorites_count": 0,
"recitations_count": 0
}
- url:
/users/search
- method:
GET
- parameters:
query
required // minimum2
characters. search keywordcertified
optional //boolean
- Authentication Required
- response: a
JSON
response like:
{
"total": 3,
"limit": 15,
"currentPage": 1,
"data": [
{
"id": 7,
"name": "Abdul Kader Zein Eddin",
"username": "abd",
"avatar": null,
"country": "tr",
"recitations_count": 0
}
]
}
- url:
/follows/{model}
//{model}
is theUser ID
orusername
to follow - method:
POST
- Authentication Required
- response: normal
Success response
.
- url:
/follows/{model}
//{model}
is theUser ID
orusername
to un-follow - method:
DELETE
- Authentication Required
- response: normal
Success response
.
- url:
/follows/{model}/follower
//{model}
is theUser ID
orusername
to delete - method:
DELETE
- Authentication Required
- response: normal
Success response
.
Return a list of un-confirmed "following requests" of a private user.
- url:
/profiles/{model}/followers/pending
//{model}
is theUser ID
orusername
of logged in user - method:
GET
- Authentication Required
- response: a
JSON
response like:
{
"total": 1,
"limit": 15,
"currentPage": 1,
"data": [
{
"id": 7, // the request ID
"user_id": 2, // the user ID
"name": "Mohammad",
"username": "mhd",
"avatar": null,
"certified": 0,
"date": 1482620154 // request date
}
]
}
- url:
/profiles/{model}/followers/pending/{id}
//{model}
is theUser ID
orusername
of logged in user, {id} is the Following request ID. - method:
POST
- Authentication Required
- response: normal
Success response
.
- url:
/profiles/{model}/followers/pending/{id}
//{model}
is theUser ID
orusername
of logged in user, {id} is the Following request ID. - method:
DELETE
- Authentication Required
- response: normal
Success response
.
- url:
/profiles/{model}/followers
//{model}
is theusername
orID
of user. - method:
GET
- Authentication Required
- response: a
JSON
response like:
{
"total": 1,
"limit": 15,
"currentPage": 1,
"data": [ // Array of users
{
"id": 4,
"name": "aboudeh",
"username": "abd",
"avatar": "http://rattil.app/public/profiles/a87ff679a2f3e71d9181a67b7542122c.jpg",
"country": null,
"recitations_count": 1
}
]
}
- url:
/profiles/{model}/following
//{model}
is theusername
orID
of user. - method:
GET
- Authentication Required
- response: a
JSON
response like:
{
"total": 1,
"limit": 15,
"currentPage": 1,
"data": [ // Array of users
{
"id": 4,
"name": "aboudeh",
"username": "abd",
"avatar": "http://rattil.app/public/profiles/a87ff679a2f3e71d9181a67b7542122c.jpg",
"country": null,
"recitations_count": 1
}
]
}
- url:
/likes/recitation/{model}
//{model}
is theID
of recitation - method:
POST
- Authentication Required
- response: normal
Success response
.
- url:
/likes/recitation/{model}
//{model}
is theID
of recitation - method:
DELETE
- Authentication Required
- response: normal
Success response
.
- url:
/favorites/{model}
//{model}
is theID
of recitation - method:
POST
- Authentication Required
- response: normal
Success response
.
- url:
/favorites/{model}
//{model}
is theID
of recitation - method:
DELETE
- Authentication Required
- response: normal
Success response
.
- url:
/profiles/{model}/favorites
//{model}
is theusername
orID
of user. - method:
GET
- Authentication Required
- response: a
JSON
response like:
{
"total": 1,
"limit": 15,
"currentPage": 1,
"data": [ // Array of favorites recitations
{
"id": 2,
"slug": "xxxx",
"user": {
"id": 4,
"name": "abdulkader",
"username": "abd",
"avatar": "http://rattil.app/public/profiles/a87ff679a2f3e71d9181a67b7542122c.jpg",
"country": null,
"recitations_count": 1
},
"narration": {
"id": 1,
"name": "Test",
"weight": 2
},
"fromVerse": {
"id": 1,
"number": 1,
"text": "ssss",
"cleanText": "ssss",
"characters": "sss"
},
"toVerse": {
"id": 2,
"number": 2,
"text": "dddd",
"cleanText": "dddd",
"characters": "dddd"
},
"date": 1476232607,
"commentsCount": 0,
"favoritesCount": 0,
"likesCount": 0
} ]
}
return the comments of a recitation
- url:
/recitations/{model}/comments
//{model}
is theID
of recitation - method:
GET
- Authentication required
- response: a
JSON
response like:
{
"total": 1,
"limit": 15,
"currentPage": 1,
"data": [ // Array of comments
{
"id": 1,
"text": "Test Comment",
"url": null,
"verified": false,
"user": {
"id": 4,
"name": "abdulkader",
"username": "abd",
"avatar": "http://rattil.app/public/profiles/a87ff679a2f3e71d9181a67b7542122c.jpg",
"verified": false
},
"date": 1476232607
}
]
}
- url:
/recitations/{model}/comments
//{model}
is theID
of recitation - method:
POST
- Authentication required
- parameters:
text
required // Comment textfile
optional // audio file. Only for certified users
- response: normal
Success response
.
- url:
/comments/{model}
//{model}
is theID
of Comment - method:
DELETE
- Authentication required
- response: normal
Success response
.
- url:
/{type}/{model}/report
//type
is the type of model [recitations
|comments
],{model}
is theID
of model - method:
POST
- Authentication required
- parameters:
reason_id
required // Comment textmessage
optional // description message,max:500
characters
- response: normal
Success response
.
- url:
/assists/languages
- method:
GET
- Authentication required
- response: a
JSON
response like:
[
{
"key": "en",
"name": "English"
},
{
"key": "ar",
"name": "العربية"
}
]
- url:
/assists/countries
- method:
GET
- Authentication required
- response: a
JSON
response like:
[
{
"key": "sa",
"name": "Saudi Arabia"
},
{
"key": "tr",
"name": "Turkey"
}
]
- url:
/assists/narrations
- method:
GET
- Authentication required
- response: a
JSON
response like:
[
{
"id": 1,
"weight": 1,
"name": "Test narration"
}
]
Get the list of report's reasons.
It is related to the model that you want to report it.
- url:
/assists/reasons/{type}
//available [comments
|recitations
] - method:
GET
- Authentication required
- response: a
JSON
response like:
[
{
"id": 1,
"name": "Reason of report"
}
]