Query Posts and Submissions

Written by Grant - Postpone Founder
Updated 1 year ago

First, read through our API introduction article for info on how to work with our API playground and make API calls.

Querying Scheduled Submissions

The following query retrieves a list of scheduled Submissions, including their Posts (grouping) object which contains the title and link to submit from a Reddit account.

The query includes a limit to control how many results are returned and a page to support pagination. The initial page is 1. The maximum limit is 500.

The query also supports a number of filters to reduce the results, such as the submission start date, submission end date, Reddit accounts (usernames), subreddits, and subreddit labels.

query scheduledSubmissions(
  $limit: Int
  $page: Int
  $startDate: DateTime
  $endDate: DateTime
  $accounts: [String]
  $subreddits: [String]
  $labels: [String]
) {
  scheduledSubmissions(
    limit: $limit
    page: $page
    startDate: $startDate
    endDate: $endDate
    accounts: $accounts
    subreddits: $subreddits
    labels: $labels
  ) {
    total
    objects {
      id
      subreddit
      postAt
      title
      tries
      post {
        id
        title
        link
        thumbnailUrl
        redditUsername
      }
    }
  }
}

Querying Submitted Posts

The following query retrieves a list of submitted Submissions and Posts, including their Submission Attempts (for each time Postpone attempted to submit the post), Results (for successful submissions), or Errors (for unsuccessful submissions).

The query includes a limit to control how many results are returned and a page to support pagination. The initial page is 1. The maximum limit is 500.

The query also supports a number of filters to reduce the results, such as the submission start date, Reddit accounts (usernames), and subreddits.

query submissions(
  $orderBy: String
  $limit: Int
  $page: Int
  $startDate: DateTime
  $accounts: [String]
  $subreddits: [String]
) {
  submissions(
    orderBy: $orderBy
    limit: $limit
    page: $page
    startDate: $startDate
    accounts: $accounts
    subreddits: $subreddits
  ) {
    total
    objects {
      id
      subreddit
      title
      postAt
      tries
      removeAt
      removeMinUpvotes
      post {
        id
        title
        redditUsername
        link
        thumbnailUrl
      }
      submissionAttempts {
        id
        dateAttempted
        success
        url
        errorCode
        errorMessage
      }
      result {
        id
        dateCreated
        url
        upvotes
        comments
        removedByCategory
        isRemoved
        isRemovedByAuthor
      }
      error {
        errorCode
        message
        suggestedFix
        dateFailed
        dateAcknowledged
      }
    }
  }
}
Did this answer your question?