Status: 200 OK
{
"success": true,
"active": false,
"message": "<p>Du bist fast fertig! Wir haben eine Aktivierungsmail gesendet an <b>example address</b>. Bitte folge den Anweisungen in der E-Mail, um dein Konto zu aktivieren.</p><p>Wenn keine E-Mail ankommt, überprüfe bitte deinen Spam-Ordner.</p>"
}
이 요청을 보내실 때 자격 증명이 실제로는 올바르게 전달되지 않는 것 같습니다. 이 엔드포인트는 가입 양식에 사용되므로 API 자격 증명이 필요하지 않은 특수한 경우입니다. 현재 받고 계신 응답은 사용자가 가입할 때 API 요청이 아니라고 감지된 경우에 반환되는 것입니다.
인증이 필요한 다른 API 요청, 예를 들어 카테고리 생성 요청을 시도해 보시고 작동하는지 확인해 주시겠습니까? 또한 관리자 API 페이지에서 키가 마지막으로 사용된 시간을 확인하여 사용자 생성 API 요청에서 키가 올바르게 사용되고 있는지 살펴볼 수도 있습니다.
자격 증명 없이 JSON 요청을 보내어 문제를 재현할 수 있었습니다:
자격 증명 없는 JSON 요청
curl -i -sS -X POST "http://localhost:3000/users.json" -H "Content-Type: application/json" -d "{\"name\": \"8525f374d470a2e3f22c\", \"active\": \"true\", \"username\": \"8525f374d470a2e3f22c\", \"email\": \"8525f374d470a2e3f22c@example.com\", \"password\": \"65d18e465472452771e02b3462260ea1\"}"
HTTP/1.1 200 OK
{"success":true,"active":false,"message":"\u003cp\u003eYou’re almost done! We sent an activation mail to \u003cb\u003e8525f374d470a2e3f22c@example.com\u003c/b\u003e. Please follow the instructions in the mail to activate your account.\u003c/p\u003e\u003cp\u003eIf it doesn’t arrive, check your spam folder.\u003c/p\u003e"}
그리고
자격 증명 있는 JSON 요청
curl -i -sS -X POST "http://localhost:3000/users.json" -H "Content-Type: application/json" -H "Api-Key: 079fb2bb12d3b436bb11bde8eb58aaa9a36560fa7d79b14b3087aa40b1ebc2c4" -H "Api-Username: blake.erickson" -d "{\"name\": \"da4be85b6046f9c9b9e1\", \"active\": \"true\", \"username\": \"da4be85b6046f9c9b9e1\", \"email\": \"da4be85b6046f9c9b9e1@example.com\", \"password\": \"65d6f0589c5f234de4ad31662b3a17a2\"}"
HTTP/1.1 200 OK
{"success":true,"active":true,"message":"Your account is activated and ready to use.","user_id":29}