SUBMIT_POST

The SUBMIT_POST handler allows users to create or edit posts. Posts can include text, media URLs, and additional data, along with hashtags.

Interaction Format

To interact with this handler, use the following format:

Send({
    Target = "Process_ID", -- Replace with the actual process ID
    Action = "SUBMIT_POST",
    Tags = {
        content = "Post content goes here",
        media_urls = '["https://example.com/media1.jpg", "https://example.com/media2.jpg"]', -- JSON array of URLs (optional)
        post_extra_data = '{"key": "value"}', -- JSON string (optional)
        visibility = "public", -- Can be "public" or other custom visibility rules (optional)
        post_id = "123" -- Include only if updating an existing post (optional)
    }
})

Input Parameters

Field
Type
Required
Description

content

String

Yes

Post content with up to 2000 characters.

media_urls

JSON Array

No

Array of media URLs (e.g., images or videos) with each URL ≤200 characters.

post_extra_data

JSON String

No

Additional post data in JSON format.

visibility

String

No

Visibility level of the post (default: public).

post_id

String

No

Post ID for updating an existing post. If omitted, a new post will be created.

Validations

  • content: Must be ≤2000 characters.

  • media_urls: Must be a valid JSON array of URLs, each ≤200 characters.

  • post_extra_data: Must be valid JSON.

  • Post ID: Required for editing an existing post.

Response Format

Success

{
    "status": "success",
    "message": "Post created successfully" or "Post updated successfully",
    "data": {
        "post_id": "generated_post_id",
        "address": "user_address",
        "content": "post_content",
        "media_urls": ["https://example.com/media1.jpg"],
        "post_extra_data": {"key": "value"},
        "visibility": "public",
        "is_edited": true or false,
        "hashtags": ["hashtag1", "hashtag2"],
        "created_at": "timestamp",
        "updated_at": "timestamp"
    }
}

Error

{
    "status": "error",
    "message": "Error message explaining the issue"
}

Last updated