Sqabl APIs
  1. Posts
Sqabl APIs
  • APIs
    • Auth
      • Sign Up
      • Sign In
      • Sign Out
      • Refresh Access Token
      • Get user by token
      • Change password
    • OTP
      • Verify OTP
      • Generate OTP
      • OTP Status
    • User
      • Get user
      • Get user by token
      • Update user
      • Get user's followers
      • Get user's followees
      • Get user's referred members
      • Get user's interacted items
      • Get user's bookmarks
      • Flag a user
      • Follow user
      • Unfollow user
      • Block a user
      • Unblock a user
      • Delete user's picture
      • Delete user
    • Users
      • Get users
    • Arenas
      • Get arenas
      • Create an arena
      • Invite users to arenas
    • Arena
      • Get arena
      • Update arena
      • Join an arena
      • Leave an arena
      • Get arena members
      • Add users to arena
      • Remove members from an arena
      • Update an arena member
    • Posts
      • Get posts
        GET
      • Create a post
        POST
    • Post
      • Get a post
      • Update a post
      • Delete a post
      • Flag a post
      • Flame a post
      • Unflame a post
      • Save a post
      • Unsave a post
      • Hide a post
      • Get post participants
      • Participate in a post
      • Get post comments
      • Comment on a post
    • Comment
      • Get comment
      • Delete a comment
      • Flag a comment
      • Flame a comment
      • Unflame a comment
      • Save a comment
      • Unsave a comment
    • Alerts
      • Get user's alerts
      • Mark some or all alerts read
    • Flags
      • get flags
    • Faqs
      • get faqs
    • Interests
      • get interests
    • Search
      • get popular search keywords
    • Signed Upload URL
      • get signed url for upload
  1. Posts

Create a post

Prod Env
https://api.sqabl.com/v1
Prod Env
https://api.sqabl.com/v1
POST
/posts/create

Request

Header Params
Authorization
string 
required
Example:
Bearer some-random-token
Body Params multipart/form-data
arenaId
string 
required
ID of the arena, in which the user is trying to create the post.
type
enum<string> 
required
The type of the post, must be "debate | poll | question".
Allowed values:
debatepollquestion
imageFile
file 
optional
question
string 
optional
This is required if the post type = "question".
title
string 
optional
This is required if the post type = "debate".
description
string 
optional
pollContent
string 
optional
This is required if the post type = "poll".
pollOptions[]
string 
optional
An array of strings (option values) and this is required if the post type = "poll".
duration
number 
optional
Duration of a post in seconds.
Example:
3600
scheduledStartTime
string 
optional
Must be in date-time-string format.
For instance, "2024-10-05T18:50:00+01:00";
where
year = 2024
month = 10
day = 05
time-part separator = T
hh = 18
mm = 50
ss = 00
timezone = +01:00
Example:
2024-10-05T18:50:00+01:00

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.sqabl.com/v1/posts/create' \
--header 'Authorization: Bearer some-random-token' \
--form 'arenaId=""' \
--form 'type=""' \
--form 'imageFile=@""' \
--form 'question=""' \
--form 'title=""' \
--form 'description=""' \
--form 'pollContent=""' \
--form 'pollOptions[]=""' \
--form 'duration="3600"' \
--form 'scheduledStartTime="2024-10-05T18:50:00+01:00"'

Responses

🟢200Success
application/json
Body
object {0}
Example
{
    "success": true,
    "statusCode": 200,
    "data": {
        "id": "cm1z66sxy0000u4v311cjcpzo",
        "type": "poll",
        "dateCreated": "2024-10-07 15:31:43.751Z",
        "owner": {
            "id": "cm1n5ubk200008ov3f8907ugy",
            "displayName": "Hiseous Hiseous",
            "imageSrc": "https://lh3.googleusercontent.com/a/ACg8ocICrDCtTUBH6BWXwWnRJkBHknyk9iHBfjupK_mhZrdj13z0EQ=s96-c"
        },
        "arena": {
            "id": "cm1xknwrc000008jp5hnu84m0",
            "name": "United for life"
        },
        "closed": true,
        "closingDate": "2024-10-07T16:10:43.000Z",
        "pollOptions": [
            {
                "text": "Some option text"
            },
            {
                "text": "Some option text"
            }
        ],
        "pollContent": "Some poll content."
    }
}
Previous
Get posts
Next
Post
Built with