http://localhost:5000/api
POST /auth/register
Request Body:
{
"name": "string",
"email": "string",
"password": "string"
}Response:
{
"token": "string",
"user": {
"id": "string",
"name": "string",
"email": "string",
"role": "user|admin",
"anonymousMode": "boolean"
}
}POST /auth/login
Request Body:
{
"email": "string",
"password": "string"
}Response:
{
"token": "string",
"user": {
"id": "string",
"name": "string",
"email": "string",
"role": "user|admin",
"anonymousMode": "boolean"
}
}POST /auth/google
Request Body:
{
"name": "string",
"email": "string",
"googleId": "string"
}Response:
{
"token": "string",
"user": {
"id": "string",
"name": "string",
"email": "string",
"role": "user|admin",
"anonymousMode": "boolean"
}
}POST /reports
Requires authentication
Request Body:
{
"title": "string",
"description": "string",
"category": "used car|electronics|services",
"location": "string",
"images": ["string"],
"links": ["string"]
}Response:
{
"id": "string",
"title": "string",
"description": "string",
"category": "string",
"location": "string",
"images": ["string"],
"links": ["string"],
"authorId": "string",
"status": "pending|verified|rejected",
"upvotes": "number",
"downvotes": "number",
"comments": ["string"],
"createdAt": "date",
"updatedAt": "date"
}GET /reports
Query Parameters:
category(optional): Filter by categorylocation(optional): Filter by locationsearch(optional): Search by keywordpage(optional): Page number (default: 1)limit(optional): Items per page (default: 6)
Response:
{
"reports": [
{
"id": "string",
"title": "string",
"description": "string",
"category": "string",
"location": "string",
"images": ["string"],
"links": ["string"],
"authorId": "string",
"status": "pending|verified|rejected",
"upvotes": "number",
"downvotes": "number",
"comments": ["string"],
"createdAt": "date",
"updatedAt": "date"
}
],
"pagination": {
"currentPage": "number",
"totalPages": "number",
"totalReports": "number"
}
}GET /reports/:id
Response:
{
"id": "string",
"title": "string",
"description": "string",
"category": "string",
"location": "string",
"images": ["string"],
"links": ["string"],
"authorId": "string",
"status": "pending|verified|rejected",
"upvotes": "number",
"downvotes": "number",
"comments": [
{
"id": "string",
"reportId": "string",
"userId": "string",
"content": "string",
"createdAt": "date"
}
],
"createdAt": "date",
"updatedAt": "date"
}PUT /reports/:id/verify
Requires authentication and admin role
Response:
{
"id": "string",
"title": "string",
"description": "string",
"category": "string",
"location": "string",
"images": ["string"],
"links": ["string"],
"authorId": "string",
"status": "verified",
"upvotes": "number",
"downvotes": "number",
"comments": ["string"],
"verifiedBy": "string",
"createdAt": "date",
"updatedAt": "date"
}PUT /reports/:id/upvote
Response:
{
"upvotes": "number"
}PUT /reports/:id/downvote
Response:
{
"downvotes": "number"
}POST /reports/:id/comment
Requires authentication
Request Body:
{
"content": "string"
}Response:
{
"id": "string",
"reportId": "string",
"userId": "string",
"content": "string",
"createdAt": "date"
}DELETE /reports/:id
Requires authentication (owner or admin)
Response:
{
"message": "Bildirim başarıyla silindi"
}GET /search
Query Parameters:
q(optional): Search querycategory(optional): Filter by categorylocation(optional): Filter by locationdate(optional): Filter by date
Response:
[
{
"id": "string",
"title": "string",
"description": "string",
"category": "string",
"location": "string",
"images": ["string"],
"links": ["string"],
"authorId": "string",
"status": "pending|verified|rejected",
"upvotes": "number",
"downvotes": "number",
"comments": ["string"],
"createdAt": "date",
"updatedAt": "date"
}
]GET /admin/reports/pending
Requires authentication and admin role
Response:
[
{
"id": "string",
"title": "string",
"description": "string",
"category": "string",
"location": "string",
"images": ["string"],
"links": ["string"],
"authorId": "string",
"status": "pending",
"upvotes": "number",
"downvotes": "number",
"comments": ["string"],
"createdAt": "date",
"updatedAt": "date"
}
]GET /admin/users
Requires authentication and admin role
Response:
[
{
"id": "string",
"name": "string",
"email": "string",
"role": "user|admin",
"anonymousMode": "boolean",
"createdAt": "date",
"reportCount": "number"
}
]PUT /admin/users/:userId/block
Requires authentication and admin role
Response:
{
"message": "Kullanıcı başarıyla engellendi",
"user": {
"id": "string",
"name": "string",
"email": "string",
"role": "blocked",
"anonymousMode": "boolean",
"createdAt": "date"
}
}POST /contact
Request Body:
{
"name": "string",
"email": "string",
"subject": "string",
"message": "string"
}Response:
{
"message": "Mesajınız başarıyla gönderildi"
}GET /health
Response:
{
"status": "OK",
"message": "IfşaEdici API is running"
}