Signup
회원 가입을 위한 API
Request (요청)
URL
https://soobook.devlim.net/api/user/signup/
Method
POST
Params
URL Params
None
Data Params
| name | value | type |
|---|---|---|
| username | 이메일 | string |
| password | 6자리 이상의 비밀번호 | string |
| nickname | 닉네임 | string |
Response (응답)
Success Response
- Code: 201
- Content:
{
"pk": 1,
"username": "[email protected]",
"nickname": "xyz",
}
Error Response
- Code: 400
- Reason: 키(username or password or nickname)가 없는 경우
- Content:
{
"username": [
"This field is required."
],
"password": [
"This field is required."
],
"nickname": [
"This field is required."
]
}
- Code: 400
- Reason: 키의 값이 없는 경우
- Content:
{
"username": [
"This field may not be blank."
],
"password": [
"This field may not be blank."
],
"nickname": [
"This field may not be blank."
]
}
- Code: 400
- Reason: username의 값이 이메일이 아닌 경우
- Content:
{
"username": [
"Enter a valid email address."
]
}
- Code: 400
- Reason: password 값이 6자리 이하일 경우
- Content:
{
"password": [
"Ensure this field has at least 6 characters."
]
}
Sample Call
$.ajax({
url: 'https://soobook.devlim.net/api/user/signup/',
type: 'POST',
dataType: 'json',
data: {
username: username,
password: password,
nickname: nickname,
}
})
.done(function(response) {
console.log(response);
})
.fail(function(response) {
console.log(response);
});