0% found this document useful (0 votes)
13 views3 pages

API Endpoints for Channel Management

Uploaded by

unknitin07
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views3 pages

API Endpoints for Channel Management

Uploaded by

unknitin07
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

==============================

API Endpoints: Request & Response Examples


==============================

1. System Status (GET /)


------------------------------
Request:
curl [Link] -H "X-API-Key: MySecretKey123"

Response:
{
"status": "running",
"version": "2.0",
"database": "[Link]",
"endpoints": [...]
}

2. Add Channel (POST /channels)


------------------------------
Request:
curl -X POST [Link] \
-H "X-API-Key: MySecretKey123" \
-H "Content-Type: application/json" \
-d '{
"channel_id": -1001234567890,
"channel_name": "My Channel"
}'

Response:
{
"message": "Channel added",
"channel_id": -1001234567890
}

3. List All Channels (GET /channels)


------------------------------
Request:
curl [Link] -H "X-API-Key: MySecretKey123"

Response:
[
{ "channel_id": -1001234567890, "channel_name": "My Channel" },
{ "channel_id": -1009876543210, "channel_name": "Another Channel" }
]

4. Remove Channel (DELETE /channels/{id})


------------------------------
Request:
curl -X DELETE [Link] -H "X-API-Key:
MySecretKey123"

Response:
{ "message": "Channel deactivated" }

5. Get Channel Members (GET /members)


------------------------------
Request:
curl "[Link] -H "X-API-Key:
MySecretKey123"

Response:
[
{
"user_id": 123456789,
"username": "john_doe",
"status": "joined",
"updated_at": "2025-09-30T10:30:00"
}
]

6. Get Join Requests (GET /requests)


------------------------------
Request:
curl "[Link] -H "X-API-Key:
MySecretKey123"

Response:
[
{
"user_id": 555555555,
"username": "new_user",
"updated_at": "2025-09-30T12:00:00"
}
]

7. Get Channel Statistics (GET /stats/{id})


------------------------------
Request:
curl [Link] -H "X-API-Key: MySecretKey123"

Response:
{
"channel_id": -1001234567890,
"total_members": 1523,
"pending_requests": 45,
"left_count": 234,
"banned_count": 12
}

8. Get User Status in Specific Channel (GET /user/{id})


------------------------------
Request:
curl "[Link] -H "X-API-
Key: MySecretKey123"

Response:
{
"user_id": 123456789,
"username": "john_doe",
"channel_id": -1001234567890,
"status": "joined",
"last_updated": "2025-09-30T10:30:00"
}

9. Get User Status Across All Channels (GET /user/{id}/all)


------------------------------
Request:
curl [Link] -H "X-API-Key: MySecretKey123"

Response:
[
{
"channel_id": -1001234567890,
"username": "john_doe",
"status": "joined",
"last_updated": "2025-09-30T10:30:00"
},
{
"channel_id": -1009876543210,
"username": "john_doe",
"status": "left",
"last_updated": "2025-09-29T15:20:00"
}
]

10. API Documentation (GET /docs)


------------------------------
Request:
[Link]

Response:
Interactive Swagger UI page

You might also like