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 / Messaging / Messages
Send message - 1 Get chats - 2 Get messages - 3 Search messages - 4 Delete Message - 5 Clear chat - 6

Send message / image

Please use this (https://twittner.com/mobile_api/send_message) API for accessing the endpoint of sending a message


Post parameters

Field Value Remarks
session_id ​Access token ID E.g. de25cc16eb00960f076...
user_id ​User ID of the interlocutor E.g. 4567
type ​Message type Text or Image E.g. One of these options (text/media)
image ​Message image file E.g. some-picture.jpeg
message ​Message text (Max length 3000) E.g. `Hi! How are you?`

Success response

{
    	"code": 200,
    	"message": "Message sent",
    	"data": {
    		"id": 49,
    		"sent_by": 7,
    		"sent_to": 78,
    		"owner": true,
    		"message": "Image",
    		"media_file": "https://twittner.com/upload/images/2020/11/lbEG1WesAJdnqVWuUVSd_21_00ae49e181b4a21f86d2338eed424e7b_image_original.jpg",
    		"media_type": "image",
    		"seen": "0",
    		"deleted_fs1": "N",
    		"deleted_fs2": "N",
    		"time": "21 Nov, 2020 03:11",
    		"side": "right",
    		"media_name": "TWTNR-IMG-1605960603"
    	}
    }
    

Error responses

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

    {
    	"code": 400,
    	"message": "Interlocutor ID is missing or invalid",
    	"data": []
    }

    {
    	"code": 400,
    	"message": "You do not have permission direct messages to this chat",
    	"data": []
    }

    {
    	"code": 400,
    	"message": "Your account has been blocked by this account",
    	"data": []
    }

    {
    	"code": 500,
    	"message": "An error occurred while processing your request. Please try again later.",
    	"data": []
    }

    {
    	"code": 400,
    	"message": "The media type of the message is invalid or missing",
    	"data": []
    }
    

Get chats

Please use this (https://twittner.com/mobile_api/get_chats) API for accessing the endpoint of the chat list


Get parameters

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

Success response

{
        "code": 200,
        "message": "Chats successfully",
        "data": [
            {
            "user_id": 78,
            "username": "turki",
            "name": "First name Last name",
            "avatar": "https://twittner.com/upload/default/avatar.png",
            "verified": "0",
            "chat_id": 9,
            "time": "17 minutes ago",
            "last_message": "y",
            "new_messages": "",
            "chat_url": "https://twittner.com/conversation/@turki"
            },
            {"user_id": 34, "username": "jack_nelson", "name": "Jack Nelson", "avatar": "https://twittner.com/upload/default/avatar.png",…}
        ]
    }
    

Error responses

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

Get Messages

Please use this (https://twittner.com/mobile_api/get_messages) API for accessing the endpoint of the message list


Get parameters

Field Value Remarks
session_id ​Access token ID E.g. de25cc16eb00960f076...
user_id ​User ID of the interlocutor E.g. 4567
offset_up First message offset ID This is only needed when loading old messages from the current chat.
offset_down Last message offset ID This is only needed when loading new messages from the current chat.
page_size ​Total message limit for each request Recommended: 20

Success response

{
        "code": 200,
        "data": [
            {
                "id": 86,
                "sent_by": 7,
                "sent_to": 78,
                "owner": true,
                "message": "1",
                "media_file": "",
                "media_type": "none",
                "seen": "0",
                "deleted_fs1": "N",
                "deleted_fs2": "N",
                "time": "22 Nov, 2020 10:11",
                "side": "right"
            },
            {...}
        ]
    }
    

Error responses

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

    {
        "code": 400,
        "message": "Interlocutor ID is missing or invalid",
        "data": []
    }

    {
        "code": 204,
        "message": "No data found",
        "data": []
    }
    

Search Messages

Please use this (https://twittner.com/mobile_api/search_messages) API for accessing the message search endpoint


Get parameters

Field Value Remarks
session_id ​Access token ID E.g. de25cc16eb00960f076...
user_id ​User ID of the interlocutor E.g. 4567
query Search keyword E.g. `Hello`
page_size Search result rows limit Default is (50) rows
offset_up First message offset ID This is only needed when loading previous messages.
offset_down Last message offset ID This is only needed when loading next messages.

Success response

{
        "code": 200,
        "total": 1,
        "data":[
            {
                "id": 8,
                "sent_by": 10,
                "sent_to": 5,
                "owner": true,
                "message": "Hello!",
                "media_file": "",
                "media_type": "none",
                "seen": "0",
                "deleted_fs1": "N",
                "deleted_fs2": "N",
                "time": "23 Mar, 2021 11:03",
                "side": "right",
                "media_raw": ""
            }
        ]
    }
    

Error responses

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

    {
        "code": 400,
        "message": "Interlocutor ID is missing or invalid",
        "data": []
    }

    {
        "code": 204,
        "data": [],
        "message": "No data found"
    }
    

Delete Message

Please use this (https://twittner.com/mobile_api/delete_message) API for accessing the endpoint of deleting a chat message


Post parameters

Field Value Remarks
session_id ​Access token ID E.g. de25cc16eb00960f076...
message_id ​Deleted message int ID E.g. `34`

Success response

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

Error responses

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

    {
        "code": 400,
        "message": "Message ID is missing or invalid",
        "data": []
    }

    {
        "code": 400,
        "message": "A message with this ID was not found. Please check your details!",
        "data": []
    }
    

Clear Chat/Delete

Please use this (https://twittner.com/mobile_api/clear_chat) API for accessing the endpoint of clearing & deleting chat history


Post parameters

Field Value Remarks
session_id ​Access token ID E.g. de25cc16eb00960f076...
user_id ​User ID of the interlocutor E.g. 4567
delete_chat ​Delete chat after clearing E.g. One of these options (1/0)

Success response

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

Error responses

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

    {
        "code": 400,
        "message": "Interlocutor ID is missing or invalid",
        "data": []
    }