GymFit - API
  • Get started
  • Login
  • Social login
  • Signup
  • Reset password
  • Timeline feed
  • Profile data (2)
  • Report profile
  • Block user
  • Notification token
  • Change password
  • Refresh access token
  • Logout user
  • Verify user
  • Post & Reply (4)
  • Vote polls
  • Create swift (7)
  • Thread data (2)
  • Like / Unlike
  • Report post
  • Repost post
  • Bookmarks (2)
  • Post likes
  • Delete post
  • Search hashtags
  • Search people
  • Search posts
  • Pin post to profile
  • Update profile data
  • Avatar & Cover (3)
  • User privacy (2)
  • Follow & Unfollow
  • Fetch following
  • Fetch followers
  • Follow requests (3)
  • Get notifications
  • Delete notifications
  • Messaging (6)
  • Change language
How it works - 1 Upload media - 2 Delete media - 3 Publish - 4 Privacy - 5

Upload post media

Please use this (https://gymfit.me/mobile_api/upload_post_media) API endpoint for uploading post multimedia files


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)

{
    	"message": "Media file uploaded successfully",
    	"code": 200,
    	"data": {
    		"media_id": 4,
    		"url": "An absolute URL of new uploded media file",
    		"type": "Image/Video"
    	}
    }
    

Success response (Video uplaod)

{
    	"message": "Media file uploaded successfully",
    	"code": 200,
    	"data": {
        	"media_id": 18,
        	"type": "Video",
        	"source": "An absolute URL of new uploded video file",
        	"poster": "An absolute URL of auto generated video thumbnail file"
        }
    }
    

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": []
    }

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

Delete post media

Please use this (https://gymfit.me/mobile_api/delete_post_media) API endpoint for deleteing post multimedia files


Post parameters

Field Value Remarks
session_id ​Access token ID E.g. de25cc16eb00960f076...
type ​Media file type (Image/Video) E.g. image
media_id ​Media file ID E.g. 45

Success response

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

Error responses

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

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

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

Publish Post / Reply

Please use this (https://gymfit.me/mobile_api/publish_post) API endpoint for pulishing port or it's reply


Post parameters

Field Value Remarks
session_id ​Access token ID E.g. de25cc16eb00960f076...
post_text ​Post text message (Max. 600 chars) E.g. `Hello world!`
thread_id ​Thered int. ID Required only for reply
gif_src ​Gif image source URL Only if the post does not contain other media files (Video or Image)
og_data ​Extracted OG data from URL Only if the post does not contain other media files (Video or Image or GIF)
poll_data ​Poll JSON data Json array with poll option objects. E.g. [{"value": "Option 1"}, {"value": "Option 2"}, {..}] From 2 to 4 options
privacy ​Publication privacy settings (Ignored for replies to posts) One of those values (everyone, followers, mentioned)

Success response

{
    	"posts_total": 4048,
    	"data": {
    		"id": 13,
    		"user_id": 7,
    		"text": "video",
    		"type": "text",
    		"replys_count": "0",
    		"reposts_count": "0",
    		"likes_count": "0",
    		"status": "active",
    		"thread_id": 0,
    		"target": "publication",
    		"og_data": "",
    		"time": "just now",
    		"advertising": false,
    		"time_raw": "1605602544",
    		"og_text": "video",
    		"og_image": "statics/img/logo.png",
    		"url": "https://gymfit.me/thread/13",
    		"can_delete": true,
    		"media": [],
    		"is_owner": true,
    		"has_liked": false,
    		"has_saved": false,
    		"has_reposted": false,
    		"reply_to": {
    			"id": 7,
    			"url": "https://gymfit.me/@john_not_do",
    			"avatar": "https://gymfit.me/upload/default/avatar.png",
    			"username": "@john_not_doe",
    			"name": "John Doe", 
    			"gender": "M",
    			"is_owner": true,
    			"thread_url": "https://gymfit.me/thread/36"
    		},
    		"offset_id": 13,
    		"owner":{
    			"id": 7,
    			"url": "https://gymfit.me/@john_not_doe",
    			"avatar": "https://gymfit.me/upload/default/avatar.png",
    			"username": "@john_not_doe",
    			"name": "John Doe",
    			"verified": "2"
    		}
    	},
    	"code": 200,
    	"message": "Post published successfully"
    }
    

Error responses

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

    {
    	"code": 400,
    	"message": "Invalid data for publication. Please check your details",
    	"data": []
    }

    

Change post privacy

Please use this (https://gymfit.me/mobile_api/change_post_privacy) API endpoint for changing post privacy

You will need this endpoint if you want to change the privacy of the post, that is, the option "Who can reply"

However, keep in mind that this option is only available for Posts that do not have a parent chain. That is, the post should be the original post and not the answer.


Post parameters

Field Value Remarks
session_id Access token ID E.g. de25cc16eb00960f076...
post_id Publication int ID E.g. 11
privacy Publication privacy settings (Ignored for replies to posts) One of those values (everyone, followers, mentioned)

Success response

{
        "code": 200,
        "message": "Post privacy changed successfully",
        "data": []
    }
    

Error responses

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

    {
        "code": 400,
        "message": "Post ID is missing or invalid. Please check your details",
        "data": []
    }