Skip to main content

Community Endpoints

Complete reference for NexCommunity endpoints.

Base URL

https://api.govalid.org/api/v1/community/

Community Feed

Get Feed

GET /api/v1/community/feed/

Query Parameters

ParameterTypeDescription
pageintegerPage number
page_sizeintegerResults per page
filterstringFilter by type (recent, trending, friends)

Response

{
"count": 50,
"results": [
{
"id": "post-001",
"type": "qr_shared",
"user": {
"id": 123,
"username": "johndoe",
"avatar": "https://api.govalid.org/media/avatars/123.jpg"
},
"qr_code": {
"id": "abc123",
"title": "Product Certificate",
"trust_score": 85
},
"created_at": "2025-01-29T12:00:00Z"
}
]
}

Trust Votes

Cast Vote

POST /api/v1/community/vote/

Request Body

{
"qr_id": "abc123",
"vote": "trust"
}

Vote values: trust, distrust, neutral

Response

{
"success": true,
"qr_trust_score": 85,
"total_votes": 150
}

Comments

Add Comment

POST /api/v1/community/comments/

Request Body

{
"qr_id": "abc123",
"content": "This certificate looks legitimate!"
}

List Comments

GET /api/v1/community/comments/?qr_id=abc123

Friends

List Friends

GET /api/v1/community/friends/

Send Friend Request

POST /api/v1/community/friends/request/

Request Body

{
"user_id": 456
}

Accept/Reject Friend Request

POST /api/v1/community/friends/{id}/accept/
POST /api/v1/community/friends/{id}/reject/

Badges

List Badges

GET /api/v1/community/badges/

Response

{
"badges": [
{
"id": "early-adopter",
"name": "Early Adopter",
"description": "Joined during beta",
"icon": "https://api.govalid.org/media/badges/early-adopter.png",
"earned": true,
"earned_at": "2024-06-01T00:00:00Z"
},
{
"id": "active-scanner",
"name": "Active Scanner",
"description": "100+ scans",
"icon": "https://api.govalid.org/media/badges/active-scanner.png",
"earned": false,
"progress": 75
}
]
}

Search Community

GET /api/v1/community/search/?q=query

Query Parameters

ParameterTypeDescription
qstringSearch query
typestringFilter by type (users, qr_codes, hubs)

Companion Images

Upload Companion Image

POST /api/v1/community/companion-images/

Request Body (multipart/form-data)

FieldTypeDescription
qr_idstringQR code ID
imagefileImage file
captionstringOptional caption