← Reddit

Submit a Comment with Reddit API

Pipedream makes it easy to connect APIs for Reddit and 800+ other apps remarkably fast.

Trigger workflow on
HTTP requests, schedules and app events
Next, do this
Submit a Comment with the Reddit API
No credit card required
Into to Pipedream
Watch us build a workflow
Watch us build a workflow
7 min
Watch now ➜
Trusted by 250,000+ developers from startups to Fortune 500 companies:
Trusted by 250,000+ developers from startups to Fortune 500 companies

Developers Pipedream

Getting Started

Create a workflow to Submit a Comment with the Reddit API. When you configure and deploy the workflow, it will run on Pipedream's servers 24x7 for free.

  1. Configure the Submit a Comment action
    1. Connect your Reddit account
    2. Configure Text
    3. Configure Thing ID
  2. Select a trigger to run your workflow on HTTP requests, schedules or app events
  3. Deploy the workflow
  4. Send a test event to validate your setup
  5. Turn on the trigger

Details

This is a pre-built, open source component from Pipedream's GitHub repo. The component is developed by Pipedream and the community, and verified and maintained by Pipedream.

To contribute an update to an existing component or create a new component, create a PR on GitHub. If you're new to Pipedream component development, you can start with quickstarts for trigger span and action development, and then review the component API reference.

Submit a Comment on Reddit
Description:Submit a new comment or reply to a message. [See the docs here](https://www.reddit.com/dev/api/#POST_api_comment)
Version:0.0.1
Key:reddit-submit-a-comment

Code

import { axios } from "@pipedream/platform";
import reddit from "../../reddit.app.mjs";

export default {
  type: "action",
  key: "reddit-submit-a-comment",
  version: "0.0.1",
  name: "Submit a Comment",
  description: "Submit a new comment or reply to a message. [See the docs here](https://www.reddit.com/dev/api/#POST_api_comment)",
  props: {
    reddit,
    text: {
      type: "string",
      label: "Text",
      description: "The content of your comment.",
    },
    thingId: {
      propDefinition: [
        reddit,
        "thingId",
      ],
    },
  },
  async run ({ $ }) {
    const data = {
      api_type: "json",
      thing_id: this.thingId,
      text: this.text,
    };

    const res = await axios($, this.reddit._getAxiosParams({
      method: "POST",
      path: "/api/comment",
      data,
    }));

    this.reddit.checkErrors(res);
    $.export("$summary", "Your comment has been successfully submitted");
    return res?.json?.data?.things?.[0] || res;
  },
};

Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI and CLI.
LabelPropTypeDescription
RedditredditappThis component uses the Reddit app.
Texttextstring

The content of your comment.

Thing IDthingIdstring

Fullname of parent thing

Authentication

Reddit uses OAuth authentication. When you connect your Reddit account, Pipedream will open a popup window where you can sign into Reddit and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Reddit API.

Pipedream requests the following authorization scopes when you connect your account:

accountidentityeditflairhistoryreadreportsavestructuredstylessubmitsubscribevoteflairmodflairmodconfigmodflairmodlogmodpostsmodwikimysubredditswikieditwikiread

About Reddit

Reddit is a network of communities based on people's interests. Find communities you're interested in, and become part of an online community!