Group Create
MyGroup object를 생성합니다.
URL/group/
MethodPOST
Header
Key | Description | Value | Type | Require |
---|---|---|---|---|
Authorization | 요청을 보내는 유저의 token | user token | String | True |
Input data
Key | Description | Value | Type | Require | Default |
---|---|---|---|---|---|
name | 그룹 이름 | - | String | True | - |
group_type | 그룹 타입 | PUBLIC, PRIVATE, HIDDEN | String | False | PUBLIC |
profile_img | 그룹 프로필 사진 | - | Image File | False | - |
description | 그룹 설명 | - | String | False | - |
tag_names | 그룹 태그 | - | List(String) | False | - |
Success response
HTTP Status code201
Content
[
{
"pk": 2,
"owner": {
"pk": 1,
"email": "[email protected]",
"nickname": "admin",
"username": "",
"profile_img": "http://localhost:8000/media/images/no_profile.png",
"is_follow": false
},
"name": "Test Group2",
"profile_img": "http://localhost:8000/static/images/no_image.png",
"group_type": "PUBLIC",
"description": "description input test",
"tags": [
{
"pk": 9,
"name": "test4"
},
{
"pk": 10,
"name": "test5"
},
{
"pk": 11,
"name": "test6"
}
]
}]
Error response
Group name validation error
HTTP Status code400
Content
# 이미 존재하는 name으로 요청한 경우
{
"name": [
"my group의 name은/는 이미 존재합니다."
]
}
# name을 넣지않고 요청한 경우
{
"name": [
"이 항목을 채워주십시오."
]
}
Unauthorized error
HTTP Status code401
Content
{
"detail": "자격 인증데이터(authentication credentials)가 제공되지 않았습니다."
}