Twittner Twittner API
Overview
Introduction
Authentication
Login POST Signup POST Social Login POST Reset Password POST Refresh Token POST Verify Account POST Logout POST
User Profile
Profile Data POST Update Profile POST Avatar & Cover POST Privacy Settings POST Change Password POST Change Language POST Delete Account POST
Content
Post & Reply POST Timeline Feed POST Thread Data POST Pin Post POST Delete Post POST Swifts POST
Social
Follow & Unfollow POST Fetch Followers POST Fetch Following POST Follow Requests POST
Engagement
Like & Unlike POST Vote on Polls POST Bookmarks POST Repost POST Report Post POST
Search
Search Hashtags POST Search People POST Search Posts POST
Messaging
Messages POST
Notifications
Get Notifications POST Delete Notifications POST Push Token POST
Moderation
Block User POST Report Profile POST
Back to Twittner
API / Content / Swifts
How it works - 1 Upload media - 2 Delete media - 3 Publish - 4 Delete - 5 Get swifts - 6 Register view - 7

How it works?

In order to create a swift using our api, you need to know how it works in the backend.

Just sending texts and media files at one time to create a swift will not work, since it is created step by step.

Description of how the system works when creating a swift, that is (Image / Video) story

  • 1. First you upload 1 media file Video or Image
  • 2. Then just publish the swift using the endpoints described below

Upload swift media

Please use this (https://twittner.com/mobile_api/upload_swift_media) API endpoint for uploading swift media file. I.e Video or Image


Post parameters

Field Value Remarks
session_id ​Access token ID E.g. de25cc16eb00960f076...
type ​Media file type (image/video) E.g. image
file ​Media file (Image/Video) E.g. some-selfy-picture.jpeg

Success response (Image uplaod)

{
        "code": 200,
        "message": "Media file uploaded successfully",
        "data":{
            "url": "https://twittner.com/upload/images/xxxx/xx/e7tHaq16_2d.......c5_image_swift.jpeg",
            "type": "image"
        }
    }
    

Success response (Video uplaod)

{
        "code": 200,
        "message": "Media file uploaded successfully",
        "data":{
            "url": "https://twittner.com/upload/videos/xxxx/xx/e7tHaq16_2d.......c5_image_swift.mp4",
            "type": "video"
        }
    }
    

Error responses

{
        "code": 401,
        "data": [],
        "message": "Unauthorized Access"
    }

    {
    	"code": 500,
    	"message": "Media file is missing or invalid",
    	"data": []
    }


    {
    	"code": 400,
    	"message": "Media file type is missing or invalid",
    	"data": []
    }

    {
    	"code": 400,
    	"message": "You cannot attach more than 10 images to a post",
    	"data": []
    }
    

Delete swift media

Please use this (https://twittner.com/mobile_api/delete_swift_media) API endpoint for deleteing swift media file

In this case, you just need to send the above request to delete the swift media file, that is, a request without additional parameters, since the system itself will determine which file was last uploaded and delete it


Post parameters

Field Value Remarks
session_id ​Access token ID E.g. de25cc16eb00960f076...

Success response

{
        "code": 200,
        "data": [],
        "message": "Media deleted successfully"
    }
    

Error responses

{
        "code": 401,
        "data": [],
        "message": "Unauthorized Access"
    }
    

Publish swift

Please use this (https://twittner.com/mobile_api/publish_swift) API endpoint for pulishing swift

This stage of creating a swift assumes that you have already uploaded a media file, that is, a video or an image of a swift. Since the media file is required when creating a swift, unlike the description, you can send the description or not.


Post parameters

Field Value Remarks
session_id ​Access token ID E.g. de25cc16eb00960f076...
swift_text Text text message (Max. 200 chars) E.g. `Lorem ipsum`

Success response

{
        "code": 400,
        "code": 200,
        "message": "Swift published successfully",
        "data": []
    }
    

Error responses

{
        "code": 401,
        "data": [],
        "message": "Unauthorized Access"
    }
    

Delete swift

Please use this (https://twittner.com/mobile_api/delete_swift) API endpoint for deleteing swift


Post parameters

Field Value Remarks
session_id ​Access token ID E.g. de25cc16eb00960f076...
swid ​Swift hash id E.g. `zpad2HalsbsLGhdI`

Success response

{
        "code": 200,
        "message": "Swift successfully deleted",
        "data": []
    }
    

Error responses

{
        "code": 401,
        "data": [],
        "message": "Unauthorized Access"
    }
    

Get my swifts list

Please use this (https://twittner.com/mobile_api/get_swifts) API endpoint for fetching user swifts list

This endpoint will allow you to get all active swifts of the logged in user


GET parameters

Field Value Remarks
session_id ​Access token ID E.g. de25cc16eb00960f076...

Success response

{
        "code": 200,
        "data":[
            {
                "id": 5,
                "username": "@admin",
                "fname": "Turki",
                "lname": "ATL",
                "avatar": "https://twittner.com/upload/avatars/xx/xx/ZIGRH9xMQ5YXeo7s1FtI_....._thumbnail_512x512.jpeg",
                "swift":[
                    {
                        "views":[
                            "1": {
                                "id": 1,
                                "username": "@testuser",
                                "fname": "Admin",
                                "lname": "O'user",
                                "avatar": "https://twittner.com/upload/avatars/xx/xx/ZyoImsndzRPftd1UbMW5_24_3126....e6_thumbnail_512x512.jpg",
                                "name": "Admin O'user",
                                "url": "https://twittner.com/@testuser",
                                "time": "24 seconds ago"
                            }
                        ],
                        "time": "19:24",
                        "type": "image",
                        "status": "active",
                        "media":{
                            "src": "https://twittner.com/upload/images/xx/xx/lr4UGK....54450_image_swift.png"
                        },
                        "exp_time": 1623947062,
                        "text": "",
                        "seen": 0,
                        "swid": "uNpuf6SrlRzQ3xVg"
                    }
                ],
                "name": "Turki Al Muhid",
                "url": "https://twittner.com/@admin",
                "is_user": true,
                "has_unseen": false
            }
        ],
        "message": "Swifts fetched successfully"
    }
    

Error responses

{
        "code": 401,
        "data": [],
        "message": "Unauthorized Access"
    }

    {
        "code": 404,
        "data": [],
        "message": "No swifts available yet"
    }
    

Register swift view

Please use this (https://twittner.com/mobile_api/reg_swift_view) API endpoint for registering swift views

This endpoint is needed in order to send a request to the server when the swift is opened so that the system registers the swift view.


Post parameters

Field Value Remarks
session_id ​Access token ID E.g. de25cc16eb00960f076...
user_id ​Swift user ID E.g. `10`
swid ​Swift hash id E.g. `zpad2HalsbsLGhdI`

Success response

{
        "code": 200,
        "message": "Swift view registered successfully",
        "data": []
    }
    

Error responses

{
        "code": 401,
        "data": [],
        "message": "Unauthorized Access"
    }

    {
        "code": 400,
        "data":[],
        "message": "User ID is not valid or missing"
    }