API actions for the Reddit integration.
Create posts, add comments, and read the newest posts on Reddit.
Comment on a post
Add a comment to a Reddit post, or reply to another comment.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
parent_id | string | Yes | The ID of the post or comment to reply to, including its prefix. Use t3_ for a post (for example t3_1a2b3c) or t1_ for a comment (for example t1_xyz789). |
text | string | Yes | The text of your comment. |
Response
{
"comment": {
"body": "Great point!",
"id": "xyz789",
"link_id": "t3_1a2b3c"
}
}Create text post
Publish a text post to a subreddit.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
subreddit | string | Yes | The name of the subreddit to post in, without the 'r/' prefix, for example programming. |
title | string | Yes | The title of the post. |
text | string | No | The body text of the post. Leave blank to post a title only. |
Response
{
"post": {
"id": "1a2b3c",
"subreddit": "programming",
"title": "Interesting Discussion",
"url": "https://reddit.com/r/programming/comments/1a2b3c/"
}
}Get posts
Get posts from a subreddit, sorted the way you choose.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
subreddit | string | Yes | The name of the subreddit to read from, without the 'r/' prefix, for example programming. |
sort | string | No | Which posts to return and how they are ordered. |
limit | number | No | The maximum number of posts to return, from 1 to 100. Defaults to 10. |
Response
{
"posts": [
{
"id": "1a2b3c",
"subreddit": "technology",
"title": "New Feature Announcement",
"url": "https://reddit.com/r/technology/comments/1a2b3c/"
}
]
}