> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# Find Posts

- Component: `appmixer.buffer.core.FindPosts`
- Kind: Action
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.buffer 1.0.0](https://connectors.appmixer.com/connector/appmixer.buffer/1.0.0.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.buffer/1.0.0/component/appmixer.buffer.core.FindPosts>

Find posts of a Buffer organization by channel, status and date. Returns up to 100 posts.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Organization (`organizationId`) | text | Pick a Buffer organization, or type its Organization ID. |
| Channel (`channelId`) | text | Only posts of this channel. Pick a channel, or type its Channel ID. Leave empty for all channels. |
| Status (`status`) | select | Only posts with this status. |
| Created After (`createdAfter`) | date-time | Only posts created at or after this time. |
| Created Before (`createdBefore`) | date-time | Only posts created at or before this time. |
| Due After (`dueAfter`) | date-time | Only posts scheduled at or after this time. |
| Due Before (`dueBefore`) | date-time | Only posts scheduled at or before this time. |
| Sort By (`sortBy`) | select | - |
| Sort Direction (`sortDirection`) | select | - |
| Output Type (`outputType`) | select | Choose whether you want to receive the result set as one complete list, or first item only or one item at a time or stream the items to a file. |

## Output ports

### Port `out`

Variables are loaded dynamically from `/component/appmixer/buffer/core/FindPosts?outPort=out&ignoreAuth=true`.

### Port `notFound`

_No fields defined for this port._

## Full metadata (component.json)

```json
{
  "name": "appmixer.buffer.core.FindPosts",
  "label": "Find Posts",
  "description": "Find posts of a Buffer organization by channel, status and date. Returns up to 100 posts.",
  "author": "Appmixer <info@appmixer.com>",
  "version": "1.0.0",
  "auth": {
    "service": "appmixer:buffer"
  },
  "quota": {
    "manager": "appmixer:buffer",
    "resources": "requests",
    "scope": {
      "userId": "{{userId}}"
    }
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string"
          },
          "channelId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "createdAfter": {
            "type": "string",
            "format": "date-time"
          },
          "createdBefore": {
            "type": "string",
            "format": "date-time"
          },
          "dueAfter": {
            "type": "string",
            "format": "date-time"
          },
          "dueBefore": {
            "type": "string",
            "format": "date-time"
          },
          "sortBy": {
            "type": "string",
            "enum": [
              "dueAt",
              "createdAt"
            ]
          },
          "sortDirection": {
            "type": "string",
            "enum": [
              "desc",
              "asc"
            ]
          },
          "outputType": {
            "type": "string",
            "default": "array"
          }
        },
        "required": [
          "organizationId"
        ]
      },
      "inspector": {
        "inputs": {
          "organizationId": {
            "type": "text",
            "index": 1,
            "label": "Organization",
            "tooltip": "Pick a Buffer organization, or type its Organization ID.",
            "source": {
              "url": "/component/appmixer/buffer/core/ListOrganizations?outPort=out",
              "data": {
                "properties": {
                  "isSource": true
                },
                "transform": "./ListOrganizations#toSelectArray"
              }
            }
          },
          "channelId": {
            "type": "text",
            "index": 2,
            "label": "Channel",
            "tooltip": "Only posts of this channel. Pick a channel, or type its Channel ID. Leave empty for all channels.",
            "source": {
              "url": "/component/appmixer/buffer/core/ListChannels?outPort=out",
              "data": {
                "messages": {
                  "in/organizationId": "inputs/in/organizationId"
                },
                "properties": {
                  "isSource": true
                },
                "transform": "./ListChannels#toSelectArray"
              }
            }
          },
          "status": {
            "type": "select",
            "index": 3,
            "label": "Status",
            "tooltip": "Only posts with this status.",
            "options": [
              {
                "label": "All",
                "value": ""
              },
              {
                "label": "Draft",
                "value": "draft"
              },
              {
                "label": "Needs Approval",
                "value": "needs_approval"
              },
              {
                "label": "Scheduled",
                "value": "scheduled"
              },
              {
                "label": "Sending",
                "value": "sending"
              },
              {
                "label": "Sent",
                "value": "sent"
              },
              {
                "label": "Error",
                "value": "error"
              }
            ]
          },
          "createdAfter": {
            "type": "date-time",
            "index": 4,
            "label": "Created After",
            "tooltip": "Only posts created at or after this time."
          },
          "createdBefore": {
            "type": "date-time",
            "index": 5,
            "label": "Created Before",
            "tooltip": "Only posts created at or before this time."
          },
          "dueAfter": {
            "type": "date-time",
            "index": 6,
            "label": "Due After",
            "tooltip": "Only posts scheduled at or after this time."
          },
          "dueBefore": {
            "type": "date-time",
            "index": 7,
            "label": "Due Before",
            "tooltip": "Only posts scheduled at or before this time."
          },
          "sortBy": {
            "type": "select",
            "index": 8,
            "label": "Sort By",
            "defaultValue": "dueAt",
            "options": [
              {
                "label": "Due At",
                "value": "dueAt"
              },
              {
                "label": "Created At",
                "value": "createdAt"
              }
            ]
          },
          "sortDirection": {
            "type": "select",
            "index": 9,
            "label": "Sort Direction",
            "defaultValue": "desc",
            "options": [
              {
                "label": "Descending",
                "value": "desc"
              },
              {
                "label": "Ascending",
                "value": "asc"
              }
            ]
          },
          "outputType": {
            "type": "select",
            "label": "Output Type",
            "index": 10,
            "defaultValue": "array",
            "tooltip": "Choose whether you want to receive the result set as one complete list, or first item only or one item at a time or stream the items to a file.",
            "options": [
              {
                "label": "First Item Only",
                "value": "first"
              },
              {
                "label": "All items at once",
                "value": "array"
              },
              {
                "label": "One item at a time",
                "value": "object"
              },
              {
                "label": "Store to CSV file",
                "value": "file"
              }
            ]
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out",
      "source": {
        "url": "/component/appmixer/buffer/core/FindPosts?outPort=out&ignoreAuth=true",
        "data": {
          "properties": {
            "generateOutputPortOptions": true
          },
          "messages": {
            "in/organizationId": "dummy",
            "in/outputType": "inputs/in/outputType"
          }
        }
      }
    },
    {
      "name": "notFound"
    }
  ],
  "icon": "(data URI omitted)"
}
```
