Create post
Create reflection/post by sending a POST
request with required params.Please see body schema for required params and their description.
Query Parameters
Client API token
Header Parameters
user access token
Default value: Bearer
token type
client access token
author's access token expiry timestamp
author's uid
Request Body
- Array [
- ]
post object
the post body
Default value: false
Provide true
if this a private note of user.
list of tag ids
filters_attributes object[]
List of ayah/surah references for this reflection.You can add multiple references.
surah number
From ayah number, use from
and to
if this reflection is for range of ayah. If both from
and to
are missing, that'll means user is referencing full surah for this post.
to
ayah number. We'll use from
value if this is blank(that'll mean a single ayah is being referenced for this post)
room id
if creating post in a room/group
- 200
- 401
- 404
- 422
- 500
Example response
Schema
- Array [
- ]
- Array [
- ]
- Array [
- ]
Default value: true
Possible values: [post created successfully
]
Default value: post created successfully
post object
Post/Reflection model
The ID of the post.
the post text
The number of likes.
Whether the post should be publicly viewed or not.
The date the post was published at. Format of the date is MMMM dd, yyyy HH:mm
Whether the post is global or not. A post inside a room can be set to global and becomes visible to everyone.
Whether the post is editable or not. It will be true
if the post belongs to the current user.
Whether the post is deletable or not. It will be true
if the post belongs to the current user.
Whether the current user can report the post or not.
citation_texts object[]
translation text
name of the translation
from ayah number
to ayah number
The language of the post.
The number of views.
author object
filters object[]
tags object[]
the #tag
Default value: 0
The average time it takes to read the post
{
"success": true,
"message": "post created successfully",
"post": {
"id": 0,
"body": "string",
"likes": 0,
"draft": true,
"published_at": "string",
"global": true,
"editable": true,
"deletable": true,
"reportable": true,
"citation_texts": [
{
"id": 0,
"text": "string",
"translated_name": "string",
"from": 0,
"to": 0,
"translation_id": 0
}
],
"language": "string",
"detected_translation": 0,
"views": 0,
"comments": [
{}
],
"liked": true,
"author": {
"id": 0,
"username": "string",
"name": "string",
"verified": true,
"profile_img": "string"
},
"filters": [
{
"id": 0,
"from": 0,
"to": 0,
"indicator_text": "string"
}
],
"tags": [
{
"id": 0,
"name": "string"
}
],
"estimated_reading_time": 55018.9
}
}
{
"success": true,
"message": "post created successfully",
"post": {
"id": 0,
"body": "string",
"likes": 0,
"draft": true,
"published_at": "string",
"room_id": null,
"global": true,
"editable": true,
"deletable": true,
"reportable": true,
"citation_texts": [
{
"id": 0,
"text": "string",
"translated_name": "string",
"from": 0,
"to": 0,
"translation_id": 0
}
],
"language": "string",
"detected_translation": 0,
"views": 0,
"group": null,
"group_link": null,
"comments": [
{}
],
"liked": true,
"author": {
"id": 0,
"username": "string",
"name": "string",
"verified": true,
"profile_img": "string"
},
"filters": [
{
"id": 0,
"from": 0,
"to": 0,
"indicator_text": "string"
}
],
"tags": [
{
"id": 0,
"name": "string"
}
]
}
}
Unauthorized response, api will respond with this 401 eithr user is not logged in or do not have permission to perform some action. Like creating a post in a room, but user is not member of room.
System will also return 401 if api token is missing or invlaid.
Schema
Default value: 401
Default value: false
{
"errors": [
"string"
],
"status": 401,
"success": false
}
{
"errors": [
"You need to sign in or sign up before continuing."
],
"success": false
}
{
"message": "You don't have permission!",
"status": 401,
"success": false
}
Api will respond with 404 if creating post for a room and room doesn't exist.
Schema
{
"status": 0,
"success": true,
"error": "string"
}
{
"status": 404,
"success": false,
"error": "Couldn't find Room with 'id'=123"
}
Unprocessable entity, api will respond with this status if any required params is missing or has invalid value.
Schema
Default value: false
list of errors
Default value: error
422, unprocessable entity
{
"success": false,
"errors": [
"string"
],
"status": "error"
}
{
"success": false,
"errors": [
"string"
],
"status": "error"
}
Internal server error, api will respond with 500 if something went wrong processing the request.
Schema
Default value: false
Default value: internal server error
error message
{
"success": false,
"message": "internal server error"
}