> ## Documentation Index
> Fetch the complete documentation index at: https://developers.leadwaycrm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get posts

> Get Posts

Get Posts

```http theme={null}
POST https://services.leadconnectorhq.com/social-media-posting/{locationId}/posts/list
```

## Autorización

<ParamField header="Authorization" type="string" required>
  Bearer token generado desde el portal Leadway. Ver [Autenticación](/authentication).
</ParamField>

<ParamField header="Version" type="string" required default="2021-07-28">
  Versión de la API.
</ParamField>

## Path parameters

<ParamField path="locationId" type="string" required default="ve9EPM428h8vShlRW1KT">
  Account Id
</ParamField>

## Body

<ParamField body="type" type="string" default="Filter type">
  type must be one of the following values: recent, all, scheduled, draft, failed, in\_review, published, in\_progress and deleted
</ParamField>

<ParamField body="accounts" type="string" default="660a83fc29deacac50033e2b_omaDY3RbWtTP511e808O_17841465964543589, 38bF83fc29deacac50033e2b_omaDY3RbWtr3P11e808O_17841465964543998">
  List of account Ids separated by comma as a string
</ParamField>

<ParamField body="skip" type="string" required default="1" />

<ParamField body="limit" type="string" required default="10" />

<ParamField body="fromDate" type="string" required default="2024-01-22T05:32:49.463Z">
  From Date
</ParamField>

<ParamField body="toDate" type="string" required default="2024-03-20T05:32:49.463Z">
  To Date
</ParamField>

<ParamField body="includeUsers" type="string" required default="true">
  Include User Data
</ParamField>

<ParamField body="postType" type="object" default="post">
  Post Type must be one of the following values: - post, story, reel
</ParamField>

## Respuestas

<Accordion title="201 - Successful response">
  <ResponseField name="success" type="boolean" required default="True">
    Success or Failure
  </ResponseField>

  <ResponseField name="statusCode" type="number" required default="201">
    Status Code
  </ResponseField>

  <ResponseField name="message" type="string" required default="Fetched Posts">
    Message
  </ResponseField>

  <ResponseField name="results" type="object">
    Requested Results
  </ResponseField>

  ```json theme={null}
  {
    "success": true,
    "statusCode": 201,
    "message": "Fetched Posts"
  }
  ```
</Accordion>

<Accordion title="400 - Bad Request">
  ```json theme={null}
  {}
  ```
</Accordion>

<Accordion title="401 - Unauthorized">
  ```json theme={null}
  {}
  ```
</Accordion>

<Accordion title="422 - Unprocessable Entity">
  ```json theme={null}
  {}
  ```
</Accordion>

## Ejemplo

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST 'https://services.leadconnectorhq.com/social-media-posting/YOUR_locationId/posts/list' \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Version: 2021-07-28' \
    -H 'Content-Type: application/json' \
    -d '{
    "type": "Filter type",
    "accounts": "660a83fc29deacac50033e2b_omaDY3RbWtTP511e808O_17841465964543589, 38bF83fc29deacac50033e2b_omaDY3RbWtr3P11e808O_17841465964543998",
    "skip": "1",
    "limit": "10",
    "fromDate": "2024-01-22T05:32:49.463Z",
    "toDate": "2024-03-20T05:32:49.463Z",
    "includeUsers": "true",
    "postType": "post"
  }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://services.leadconnectorhq.com/social-media-posting/YOUR_locationId/posts/list', {
    method: 'POST',
    headers: {
      Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
      Version: '2021-07-28',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({"type": "Filter type", "accounts": "660a83fc29deacac50033e2b_omaDY3RbWtTP511e808O_17841465964543589, 38bF83fc29deacac50033e2b_omaDY3RbWtr3P11e808O_17841465964543998", "skip": "1", "limit": "10", "fromDate": "2024-01-22T05:32:49.463Z", "toDate": "2024-03-20T05:32:49.463Z", "includeUsers": "true", "postType": "post"}),
  });
  const data = await response.json();
  ```

  ```python Python theme={null}
  import os, requests
  response = requests.request(
      'POST',
      'https://services.leadconnectorhq.com/social-media-posting/YOUR_locationId/posts/list',
      headers={
          'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
          'Version': '2021-07-28',
          'Content-Type': 'application/json',
      },
      json={"type": "Filter type", "accounts": "660a83fc29deacac50033e2b_omaDY3RbWtTP511e808O_17841465964543589, 38bF83fc29deacac50033e2b_omaDY3RbWtr3P11e808O_17841465964543998", "skip": "1", "limit": "10", "fromDate": "2024-01-22T05:32:49.463Z", "toDate": "2024-03-20T05:32:49.463Z", "includeUsers": "true", "postType": "post"},
  )
  data = response.json()
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://services.leadconnectorhq.com/social-media-posting/YOUR_locationId/posts/list');
  curl_setopt_array($ch, [
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_CUSTOMREQUEST => 'POST',
      CURLOPT_HTTPHEADER => [
          'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
          'Version: 2021-07-28',
          'Content-Type: application/json',
      ],
      CURLOPT_POSTFIELDS => json_encode({'type': 'Filter type', 'accounts': '660a83fc29deacac50033e2b_omaDY3RbWtTP511e808O_17841465964543589, 38bF83fc29deacac50033e2b_omaDY3RbWtr3P11e808O_17841465964543998', 'skip': '1', 'limit': '10', 'fromDate': '2024-01-22T05:32:49.463Z', 'toDate': '2024-03-20T05:32:49.463Z', 'includeUsers': 'true', 'postType': 'post'}),
  ]);
  $data = json_decode(curl_exec($ch), true);
  ```
</CodeGroup>
