Demerzel Badges
AUTHORIZATIONBearer Token
Token
{{access_token}}
POSTCreate Badge
http://localhost:3001/api/badges/badges
AUTHORIZATIONBearer Token
Token
<token>
Bodyraw (json)
json
{
"min_score": 0,
"max_score": 35,
"name": "beginner",
"skill_id": 1
}
Example Request
201
curl
curl --location 'http://localhost:3001/api/badges/badges' \
--data '{
"min_score": 0,
"max_score": 12,
"name": "expert",
"skill_id": 1
}'
201 Created
Example Response
json
{
"data": {
"badge": {
"id": 6,
"skill_id": 1,
"name": "expert",
"min_score": 0,
"max_score": 12,
"created_at": "2023-10-07T21:37:57.598908+01:00",
"updated_at": "2023-10-07T21:37:57.598908+01:00"
}
},
"message": "Badge Created Successfully",
"status": "success"
}
Content-Type
application/json; charset=utf-8
Date
Sat, 07 Oct 2023 20:37:57 GMT
Content-Length
239
POSTAssign Badge
http://localhost:3001/api/badges/user/badges
AUTHORIZATIONBearer Token
Token
<token>
Bodyraw (json)
json
{
"assessment_id": 1
}
Example Request
201
curl
curl --location 'http://localhost:3001/api/badges/user/badges' \
--data '{
"assessment_id": 3
}'
201 Created
Example Response
json
{
"data": {
"badge": {
"id": 2,
"skill_id": 1,
"user_id": "3e9a1d54-826a-4d0b-8a48-a4e92f857fd5",
"badge_id": 1,
"assessment_id": 3,
"created_at": "2023-10-09T15:03:12.56165287Z",
"updated_at": "2023-10-09T15:03:12.56165287Z",
"User": {
"id": "",
"username": "",
"first_name": "",
"last_name": "",
"email": "",
"section_order": "",
"password": "",
"profile_pic": "",
"refresh_token": "",
"created_at": "0001-01-01T00:00:00Z",
"updated_at": "0001-01-01T00:00:00Z"
},
"Skill": {
"id": 0,
"category_name": "",
"description": "",
"parent_skill_id": null,
"created_at": "0001-01-01T00:00:00Z",
"updated_at": "0001-01-01T00:00:00Z"
},
"Badge": {
"id": 0,
"skill_id": 0,
"name": "",
"min_score": 0,
"max_score": 0,
"created_at": "0001-01-01T00:00:00Z",
"updated_at": "0001-01-01T00:00:00Z"
},
"Assessment": {
"id": 0,
"skill_id": 0,
"title": "",
"description": "",
"start_date": "0001-01-01T00:00:00Z",
"end_date": "0001-01-01T00:00:00Z",
"duration_minutes": 0,
"pass_score": 0,
"status": "",
"created_at": "0001-01-01T00:00:00Z",
"updated_at": "0001-01-01T00:00:00Z",
"Skill": {
"id": 0,
"category_name": "",
"description": "",
"parent_skill_id": null,
"created_at": "0001-01-01T00:00:00Z",
"updated_at": "0001-01-01T00:00:00Z"
}
}
}
},
"message": "Badge Assigned Successfully",
"status": "success"
}
content-type
application/json; charset=utf-8
date
Mon, 09 Oct 2023 15:03:16 GMT
content-length
1172
server
railway
GETRetrieve user Badge by skill ID
http://localhost:3001/user/badges/skill/:skillID
AUTHORIZATIONBearer Token
This request is using Bearer Token from collectionDemerzel Badges
PATH VARIABLES
skillID
1
Example Request
200
curl
curl --location 'http://localhost:3001/api/badges/user/badges/skill/1'
200 OK
Example Response
json
{
"data": {
"data": [
{
"id": 1,
"skill_id": 1,
"user_id": "3e9a1d54-826a-4d0b-8a48-a4e92f857fd5",
"badge_id": 1,
"assessment_id": 3,
"created_at": "2023-10-09T14:28:55.157149Z",
"updated_at": "2023-10-09T14:28:55.157149Z",
"User": {
"id": "",
"username": "",
"first_name": "",
"last_name": "",
"email": "",
"section_order": "",
"password": "",
"profile_pic": "",
"refresh_token": "",
"created_at": "0001-01-01T00:00:00Z",
"updated_at": "0001-01-01T00:00:00Z"
},
"Skill": {
"id": 0,
"category_name": "",
"description": "",
"parent_skill_id": null,
"created_at": "0001-01-01T00:00:00Z",
"updated_at": "0001-01-01T00:00:00Z"
},
"Badge": {
"id": 0,
"skill_id": 0,
"name": "",
"min_score": 0,
"max_score": 0,
"created_at": "0001-01-01T00:00:00Z",
"updated_at": "0001-01-01T00:00:00Z"
},
"Assessment": {
"id": 0,
"skill_id": 0,
"title": "",
"description": "",
"start_date": "0001-01-01T00:00:00Z",
"end_date": "0001-01-01T00:00:00Z",
"duration_minutes": 0,
"pass_score": 0,
"status": "",
"created_at": "0001-01-01T00:00:00Z",
"updated_at": "0001-01-01T00:00:00Z",
"Skill": {
"id": 0,
"category_name": "",
"description": "",
"parent_skill_id": null,
"created_at": "0001-01-01T00:00:00Z",
"updated_at": "0001-01-01T00:00:00Z"
}
}
},
{
"id": 2,
"skill_id": 1,
"user_id": "3e9a1d54-826a-4d0b-8a48-a4e92f857fd5",
"badge_id": 1,
"assessment_id": 3,
"created_at": "2023-10-09T15:03:12.561652Z",
"updated_at": "2023-10-09T15:03:12.561652Z",
"User": {
"id": "",
"username": "",
"first_name": "",
"last_name": "",
"email": "",
"section_order": "",
"password": "",
"profile_pic": "",
"refresh_token": "",
"created_at": "0001-01-01T00:00:00Z",
"updated_at": "0001-01-01T00:00:00Z"
},
"Skill": {
"id": 0,
"category_name": "",
"description": "",
"parent_skill_id": null,
"created_at": "0001-01-01T00:00:00Z",
"updated_at": "0001-01-01T00:00:00Z"
},
"Badge": {
"id": 0,
"skill_id": 0,
"name": "",
"min_score": 0,
"max_score": 0,
"created_at": "0001-01-01T00:00:00Z",
"updated_at": "0001-01-01T00:00:00Z"
},
"Assessment": {
"id": 0,
"skill_id": 0,
"title": "",
"description": "",
"start_date": "0001-01-01T00:00:00Z",
"end_date": "0001-01-01T00:00:00Z",
"duration_minutes": 0,
"pass_score": 0,
"status": "",
"created_at": "0001-01-01T00:00:00Z",
"updated_at": "0001-01-01T00:00:00Z",
"Skill": {
"id": 0,
"category_name": "",
"description": "",
"parent_skill_id": null,
"created_at": "0001-01-01T00:00:00Z",
"updated_at": "0001-01-01T00:00:00Z"
}
}
}
]
},
"message": "User Badge Retrieved Successfully",
"status": "success"
}
content-type
application/json; charset=utf-8
date
Mon, 09 Oct 2023 15:07:27 GMT
server
railway
transfer-encoding
chunked
GETGet User Badge Via ID
http://localhost:3001/api/badges/badges/:badge_id
AUTHORIZATIONBearer Token
Token
<token>
PATH VARIABLES
badge_id
1
Example Request
200
curl
curl --location 'http://localhost:3001/api/badges/badges/2'
200 OK
Example Response
json
{
"data": {
"badge": {
"id": 2,
"skill_id": 1,
"user_id": "3e9a1d54-826a-4d0b-8a48-a4e92f857fd5",
"badge_id": 1,
"assessment_id": 1,
"created_at": "2023-10-12T13:24:27.24279+01:00",
"updated_at": "2023-10-12T13:24:27.24279+01:00",
"skill": {
"id": 1,
"category_name": "Skilo",
"description": "No Desc",
"parent_skill_id": null,
"created_at": "0001-01-01T00:00:00Z",
"updated_at": "0001-01-01T00:00:00Z"
},
"badge": {
"id": 1,
"skill_id": 1,
"name": "beginner",
"min_score": 0,
"max_score": 35,
"created_at": "2023-10-12T13:20:39.358742+01:00",
"updated_at": "2023-10-12T13:20:39.358742+01:00"
},
"assessment": {
"id": 1,
"skill_id": 1,
"title": "Assoo",
"description": "Nunuen",
"start_date": "2023-10-12T13:22:32.90284+01:00",
"end_date": "2023-10-13T01:22:25+01:00",
"duration_minutes": 60,
"pass_score": 50,
"status": "",
"created_at": "0001-01-01T00:00:00Z",
"updated_at": "0001-01-01T00:00:00Z"
}
}
},
"message": "User Badge",
"status": "success"
}
Content-Type
application/json; charset=utf-8
Date
Thu, 12 Oct 2023 12:28:30 GMT
Content-Length
871