Bryan--
You received this message because you are subscribed to the Google Groups "API Craft" group.
To unsubscribe from this group, send email to api-craft+...@googlegroups.com.
Visit this group at http://groups.google.com/group/api-craft?hl=en.
200 if taken, 204 if available
The clients of my company's API need endpoints that let them check if a username and/or email are available when a user signs up. E.g., after the user has entered a username, the client submits a request with that username and the server responds with some kind of status indicating if the username has already been taken or not.I'm having trouble choosing RESTful paths and endpoint names for these. Any ideas?Something like:GET /something?username=foo
GET /something?emai...@bar.com
--
Keep in mind that a response that says the nickname or email is available might no longer be true by the time the write request comes in. Someone else can take the same name in the meantime. We had to design a temporary reservation which guaranteed that the write request succeeds. It also returned suggestions and reserved them if the original request to reserve failed. They used Spring remote, but for rest I would PUT the userid with the username to a /username/reservation resource and return 201 created for success, 200 for a repeated PUT of the same username, and 409 conflict with suggestions in the body if the username is already taken or reserved by someone else. Once the POST comes in, the server checks if it has an appropriate reservation for the userid, otherwise it rejects the POST with 403 forbidden and says in the response that no reservation was found and how to get one.
Best regards
Dietrich