List the posts written by a user
GET
https://api.testingapis.com/api/Posts/user/{userId}Parameters 1
| Name | Type | Description |
|---|---|---|
userIdrequired | path · integer (int32) | Author user ID (101-110 in the seed data). |
Responses
- 200
- Matching posts (an empty array if none).
- 500
- Unexpected server error.
Example
Request
curl -X GET "https://api.testingapis.com/api/Posts/user/101"Response200 OK
[
{
"id": 1,
"userId": 101,
"title": "Getting Started with REST APIs",
"body": "REST APIs are the backbone of modern web applications. In this post, we'll cover the basics of HTTP methods, status codes, and request/re…
"tags": ["api", "tutorial", "beginner"],
"publishedAt": "2025-07-01T14:00:00Z",
"likes": 42
},
{
"id": 4,
"userId": 101,
"title": "10 Git Commands Every Developer Should Know,
… (7 more lines)