Como funciona?
Para criar um post ou responder a ele usando a api, você precisa saber como ele funciona no backend.
O post e a resposta a ele são exatamente a mesma coisa, exceto que a resposta é atribuída a algum post. Quanto à sua estrutura de mídia e comportamento, é o mesmo que um post normal.
Apenas enviar textos e arquivos de mídia de uma só vez para criar um post não funcionará, pois ele é criado passo a passo.
Descrição de como o sistema funciona ao criar um post de mídia, ou seja, um post (imagem/vídeo). (Não gif)
- 1. Primeiro você envia os arquivos de mídia (vídeo/imagens)
- 2. Então, basta publicar o post ou a resposta usando os endpoints descritos abaixo
Descrição de como o sistema funciona ao criar um post (GIF/Texto)
- 1. Ao criar um post de texto simples ou uma imagem GIF, podemos enviar tudo com uma única solicitação como mostrado abaixo.
Upload post media
Please use this (https://tibita.com.br/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://tibita.com.br/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://tibita.com.br/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": "http://colibri.loc/thread/13",
"can_delete": true,
"media": [],
"is_owner": true,
"has_liked": false,
"has_saved": false,
"has_reposted": false,
"reply_to": {
"id": 7,
"url": "http://colibri.loc/@dan_kassing",
"avatar": "http://colibri.loc/upload/default/avatar.png",
"username": "@dan_kassing",
"name": "Dan Kassing",
"gender": "M",
"is_owner": true,
"thread_url": "http://colibri.loc/thread/36"
},
"offset_id": 13,
"owner":{
"id": 7,
"url": "http://colibri.loc/@dan_kassing",
"avatar": "http://colibri.loc/upload/default/avatar.png",
"username": "@dan_kassing",
"name": "Dan Kassing",
"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://tibita.com.br/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": []
}