# Get specific posts from a topic

`GET /t/{id}/posts.json`

Authentication: no security requirement declared for this operation.

Parameters:

- `Api-Key` (header, string, required)
  Type: string

- `Api-Username` (header, string, required)
  Type: string

- `id` (path, string, required)
  Type: string

Request body: application/json

Type: object

- `post_ids[]` (required)
  Type: integer

Responses:

- 200: specific posts

Content type: application/json

Type: object

- `post_stream` (optional)
  Type: object
  
  - `posts` (optional)
    Type: Array<object>
    
    Items:
      Type: object
      
      - `id` (optional)
        Type: integer
      
      - `name` (optional)
        Type: string; nullable
      
      - `username` (optional)
        Type: string
      
      - `avatar_template` (optional)
        Type: string
      
      - `created_at` (optional)
        Type: string
      
      - `cooked` (optional)
        Type: string
      
      - `post_number` (optional)
        Type: integer
      
      - `post_type` (optional)
        Type: integer
      
      - `updated_at` (optional)
        Type: string
      
      - `reply_count` (optional)
        Type: integer
      
      - `reply_to_post_number` (optional)
        Type: string; nullable
      
      - `quote_count` (optional)
        Type: integer
      
      - `incoming_link_count` (optional)
        Type: integer
      
      - `reads` (optional)
        Type: integer
      
      - `readers_count` (optional)
        Type: integer
      
      - `score` (optional)
        Type: number
      
      - `yours` (optional)
        Type: boolean
      
      - `topic_id` (optional)
        Type: integer
      
      - `topic_slug` (optional)
        Type: string
      
      - `display_username` (optional)
        Type: string; nullable
      
      - `primary_group_name` (optional)
        Type: string; nullable
      
      - `flair_name` (optional)
        Type: string; nullable
      
      - `flair_url` (optional)
        Type: string; nullable
      
      - `flair_bg_color` (optional)
        Type: string; nullable
      
      - `flair_color` (optional)
        Type: string; nullable
      
      - `version` (optional)
        Type: integer
      
      - `can_edit` (optional)
        Type: boolean
      
      - `can_delete` (optional)
        Type: boolean
      
      - `can_recover` (optional)
        Type: boolean
      
      - `can_wiki` (optional)
        Type: boolean
      
      - `read` (optional)
        Type: boolean
      
      - `user_title` (optional)
        Type: string; nullable
      
      - `actions_summary` (optional)
        Type: Array<object>
        
        Items:
          Type: object
          
          - `id` (optional)
            Type: integer
          
          - `can_act` (optional)
            Type: boolean
      
      - `moderator` (optional)
        Type: boolean
      
      - `admin` (optional)
        Type: boolean
      
      - `staff` (optional)
        Type: boolean
      
      - `user_id` (optional)
        Type: integer
      
      - `hidden` (optional)
        Type: boolean
      
      - `trust_level` (optional)
        Type: integer
      
      - `deleted_at` (optional)
        Type: string; nullable
      
      - `user_deleted` (optional)
        Type: boolean
      
      - `edit_reason` (optional)
        Type: string; nullable
      
      - `can_view_edit_history` (optional)
        Type: boolean
      
      - `wiki` (optional)
        Type: boolean
      
      - `reviewable_id` (optional)
        Type: integer
      
      - `reviewable_score_count` (optional)
        Type: integer
      
      - `reviewable_score_pending_count` (optional)
        Type: integer

- `id` (optional)
  Type: integer

## Examples

### cURL

```bash
curl -X GET 'https://discourse.example.com/t/string/posts.json' \
  -H 'Api-Key: string' \
  -H 'Api-Username: string' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "post_ids[]": 0
}'
```

### JavaScript

```javascript
const body = `{
  "post_ids[]": 0
}`;

const response = await fetch('https://discourse.example.com/t/string/posts.json', {
  method: 'GET',
  headers: {
    'Api-Key': 'string',
    'Api-Username': 'string',
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "post_ids[]": 0
}'''

response = requests.get(
    'https://discourse.example.com/t/string/posts.json',
    data=body.encode('utf-8'),
    headers={
        'Api-Key': 'string',
        'Api-Username': 'string',
        'Content-Type': 'application/json',
    },
)
print(response.text)
```
