Create a first comment
Functionality relies on the post creation endpoint.
Sometimes you want to create a post with a first comment automatically posted once your post is published. This is useful for example to add external links without compromising your post's reach, or to create artificial "engagement" to get the post more visibility.
In order for this to work, you need to create the post with the containers field, and include the comment as the first container.
For example, this is a simple post without a comment:
{
"content": "This is a comment",
....
}Skip using the content field and use the containers field instead, for both the post and the comment:
{
"containers": [
{
"content": "This is the post content",
},
{
"content": "This is a comment",
}
]
}When the post is published, the comment will be automatically posted as a reply to the post.
Comments can include media attachments, just like posts.
{
"containers": [
{
"content": "This is the post content",
},
{
"content": "This is a comment",
"media": [
{
"url": "https://example.com/media.jpg",
}
]
}
]
}