-
Notifications
You must be signed in to change notification settings - Fork 2
Badge API
ege-kaya edited this page Dec 31, 2021
·
6 revisions
GET 'api/badges/<badge_name>/'
-
Definition: Allows a user to fetch a badge by name
-
Example Response Value:
{ "@context": "https://www.wikidata.org/wiki/Q491", "type": "Badge", "name": "Friendly", "content": "This user is friendly towards other team players", "icon": { "type": "Image", "content":<base64_string> } }
-
Response Messages
- 200: OK
- 400: Bad request
GET 'api/badges/'
-
Definition: Allows a user to fetch all badges in the database
-
Example Response Value:
{ "@context": "https://www.w3.org/ns/activitystreams", "summary": "Badge list", "type": "Collection", "totalItems": 2, "items": [ { "object": { "type": "Badge", "name": "Friendly", "@context": "https://www.wikidata.org/wiki/Q491", "content": "This user is friendly towards other team players", "icon": { "type": "Image", "content":<base64_string> } } }, { "object": { "type": "Badge", "name": "Fair play", "@context": " https://www.wikidata.org/wiki/Q995616", "content": "This user plays fairly", "icon": { "type": "Image", "content":<base64_string> } } } ] }
-
Response Messages
- 200: OK
- 400: Bad request
GET 'api/users/<username>/related-events/'
-
Definition: Allows a user to fetch all events of the target user where the user can give a badge
-
Example Response Value:
{ "@context": "https://www.w3.org/ns/activitystreams", "summary": "Event list", "type": "Collection", "totalItems": 2, "items": [ { "object": { "type": "Event", "postId": 1, "title": "Beginner friendly tennis game", "eventSport": "Tennis", "eventDate": "2014-12-31T23 00 00-08 00" } }, { "object": { "type": "Event", "postId": 2, "title": "Beginner friendly football game", "eventSport": "Football", "eventDate": "2014-12-31T23 00 00-08 00" } } ] }
-
Parameters
Parameter Description Parameter Type Data Type target Username of the target user Path String -
Response Messages
- 200: OK
- 400: Bad request
POST 'api/users/<username>/badges/'
-
Definition: Allows a user to give a badge to another user
-
Example Response Value:
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Sally gave badge to Lewis",
"type": "Offer",
"actor": {
"type": "Person",
"name": "Sally",
"id": "1"
},
"object": {
"type": "Badge",
"name": "Friendly",
"attributedTo": [
{
"type": "Event",
"id": "2"
}
]
},
"target": {
"type": "Person",
"name": "Lewis",
"id": "2"
}
}
-
Parameters
Parameter Description Parameter Type Data Type target Username of the target user Path String badge_name Name of the badge to be given Body String event_id ID of the event where badge is awarded Body Integer -
Response Messages
- 201: OK
- 400: Bad request
- 404: Not found
-
Home
-
Communication plan
-
Some interesting GitHub repositories
- Git Basics
- Time Tracking
- RAM
- Lessons Learned
- System Manual
- Doğukan Akar
- Şefika Akman
- Ömer Arslan
- İbrahim Kağan Bayat
- Berkay Döner
- Ahmet Necip Görgülü
- Ege Can Kaya
- Bengisu Özaydın
- Mehmet Saraçoğlu
- Kerem Zaman
- Project Requirements
- Existing Examples
- Questions for Customers
- Customer Meeting Notes
- Scenarios and Mockups
- Class Diagram
- Sequence Diagrams
- Use Case Diagram
- Practice App API Documentation
- Rebound API Documentation
- Meeting Notes #1 (28.03.2021)
- Meeting Notes #2 (30.03.2021)
- Meeting Notes #3 (03.04.2021)
- Meeting Notes #4 (07.04.2021)
- Meeting Notes #5 (14.04.2021)
- Meeting Notes #6 (21.04.2021)
- Meeting Notes #7 (24.04.2021)
- Meeting Notes #8 (28.04.2021)
- Meeting Notes #9 (29.04.2021)
- Meeting Notes #10 (05.05.2021)
- Meeting Notes #11 (22.05.2021)
- Meeting Notes #12 (26.05.2021)
- Meeting Notes #13 (29.05.2021)
- Meeting Notes #14 (02.06.2021)
- Meeting Notes #15 (09.06.2021)