# Get Photo feed from campaign

### Endpoint

```
POST /photo-feed-from-campaign
```

Before creating a campaign, you must complete the authentication flow using the pre-login and login endpoints.

The documentation for the endpoints can be found at [authentication](https://docs.witnesschain.com/infinity-watch/apis/campaign-apis/authentication "mention")

### Request Body

```json
{
  "type": "object",
  "required": ["campaign"],
  "properties": {
    "campaign": {
      "type": "string",
      "description": "Name of the campaign to retrieve photos for"
    },
    "since": {
      "type": "string",
      "format": "date-time",
      "description": "Retrieve photos posted after this timestamp"
    }
  }
}
```

### Example Request

```json
{
  "campaign": "summer-promotion",
  "since": "2025-01-01T00:00:00Z"
}
```

### Response

```json
{
  "type": "object",
  "properties": {
    "photos": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "photo_id": {
            "type": "string",
            "description": "Unique identifier for the photo"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "URL of the photo"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp when the photo was uploaded"
          }
        }
      }
    }
  }
}
```

### Example Response

```json
{
  "photos": [
    {
      "photo_id": "photo_123456",
      "url": "https://example.com/photos/123456.jpg",
      "created_at": "2025-06-15T14:30:00Z"
    }
  ]
}
```

### Error Codes

| Status Code | Description                             |
| ----------- | --------------------------------------- |
| 400         | Bad Request - Invalid parameters        |
| 401         | Unauthorized - Authentication required  |
| 403         | Forbidden - Insufficient permissions    |
| 404         | Not Found - Campaign not found          |
| 429         | Too Many Requests - Rate limit exceeded |
| 500         | Internal Server Error                   |

### Notes

* The `since` parameter is optional and can be used to filter photos by upload date
* Photos are returned in chronological order (newest first)
* If no photos are found, an empty array will be returned

### Error Codes

| Status Code | Description                             |
| ----------- | --------------------------------------- |
| 400         | Bad Request - Invalid parameters        |
| 401         | Unauthorized - Authentication required  |
| 403         | Forbidden - Insufficient permissions    |
| 404         | Not Found - Campaign not found          |
| 429         | Too Many Requests - Rate limit exceeded |
| 500         | Internal Server Error                   |

### Notes

* The request accepts pagination parameters in the request body
* Photos are returned in paginated format with a default limit of 20 photos per request
* The `thumbnail_url` provides a smaller, optimized version of the photo for preview purposes
* Use the pagination parameters to iterate through all photos in the campaign
* Photos are sorted by creation date (newest first) by default
* The response includes metadata about each photo's dimensions and file format
* The `thumbnail_url` provides a smaller, optimized version of the photo for preview purposes
* Use the pagination parameters to iterate through all photos in the campaign
* Photos are sorted by creation date (newest first) by default
* The response includes metadata about each photo's dimensions and file format
