> 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).

# appmixer.facebook.page.CreatePagePost

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

Create a post on page.

## Input ports

### Port `content`

| Field | Type | Description |
| --- | --- | --- |
| Page (`pageId`) | select | Select page. |
| Message (`message`) | text | The main body of the post. Either message or link must be supplied. |
| Link URL (`link`) | text | The URL of a link to attach to the post. Either link or message must be supplied. |
| Published (`published`) | toggle | Whether a story is shown about this newly published object. This options is ignored when 'Publish time' is specified. |
| Publish time (`scheduled_publish_time`) | date-time | Time when this post should go live, this can be any date between ten minutes and six months from the time of the API call. If you schedule the post to less than 10 minutes from now (or you specify date in the past), time of the request plus 10 minutes will be used. |

## Output ports

### Port `newPost`

| Field | Type | Description |
| --- | --- | --- |
| `id` | string | - |
| `message` | string | - |
| `link` | string | - |
| Page ID (`pageId`) | string | - |
| Page name (`pageName`) | string | - |

## Full metadata (component.json)

```json
{
  "name": "appmixer.facebook.page.CreatePagePost",
  "author": "Martin Krcmar <martin@client.io>",
  "description": "Create a post on page.",
  "auth": {
    "service": "appmixer:facebook",
    "scope": [
      "pages_manage_posts",
      "pages_read_engagement"
    ]
  },
  "quota": {
    "manager": "appmixer:facebook",
    "resources": "requests",
    "scope": {
      "userId": "{{userId}}"
    }
  },
  "inPorts": [
    {
      "name": "content",
      "schema": {
        "type": "object",
        "properties": {
          "pageId": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "link": {
            "type": "string",
            "format": "uri"
          },
          "placeId": {
            "type": "string"
          },
          "published": {
            "type": "boolean"
          },
          "scheduled_publish_time": {
            "type": "string",
            "format": "date-time"
          }
        },
        "anyOf": [
          {
            "required": [
              "pageId",
              "message"
            ]
          },
          {
            "required": [
              "pageId",
              "link"
            ]
          }
        ]
      },
      "inspector": {
        "inputs": {
          "pageId": {
            "type": "select",
            "label": "Page",
            "index": 1,
            "source": {
              "url": "/component/appmixer/facebook/page/ListPages?outPort=pages",
              "data": {
                "transform": "./ListPages#toSelectArray"
              }
            },
            "tooltip": "Select page."
          },
          "message": {
            "type": "text",
            "label": "Message",
            "index": 2,
            "tooltip": "The main body of the post. Either message or link must be supplied."
          },
          "link": {
            "type": "text",
            "label": "Link URL",
            "index": 3,
            "tooltip": "The URL of a link to attach to the post. Either link or message must be supplied."
          },
          "published": {
            "type": "toggle",
            "label": "Published",
            "index": 5,
            "defaultValue": true,
            "tooltip": "Whether a story is shown about this newly published object. This options is ignored when 'Publish time' is specified."
          },
          "scheduled_publish_time": {
            "type": "date-time",
            "label": "Publish time",
            "index": 6,
            "tooltip": "Time when this post should go live, this can be any date between ten minutes and six months from the time of the API call. If you schedule the post to less than 10 minutes from now (or you specify date in the past), time of the request plus 10 minutes will be used."
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "newPost",
      "options": [
        {
          "label": "id",
          "value": "id",
          "schema": {
            "type": "string",
            "example": "107198938765432_122101234567890123"
          }
        },
        {
          "label": "message",
          "value": "message",
          "schema": {
            "type": "string",
            "example": "Our summer sale starts today - 20% off all drinks!"
          }
        },
        {
          "label": "link",
          "value": "link",
          "schema": {
            "type": "string",
            "example": "https://www.example.com/summer-sale"
          }
        },
        {
          "label": "Page ID",
          "value": "pageId",
          "schema": {
            "type": "string",
            "example": "107198938765432"
          }
        },
        {
          "label": "Page name",
          "value": "pageName",
          "schema": {
            "type": "string",
            "example": "Example Coffee Shop"
          }
        }
      ]
    }
  ],
  "icon": "(data URI omitted)"
}
```
