Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Need help naming endpoints for email and username availability
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Bryan Donovan  
View profile  
 More options Nov 13 2012, 2:33 pm
From: Bryan Donovan <brdono...@gmail.com>
Date: Tue, 13 Nov 2012 11:33:05 -0800 (PST)
Local: Tues, Nov 13 2012 2:33 pm
Subject: Need help naming endpoints for email and username availability

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?email=...@bar.com

Thanks!
Bryan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dolf Schimmel  
View profile  
 More options Nov 13 2012, 2:37 pm
From: Dolf Schimmel <dolfschim...@gmail.com>
Date: Tue, 13 Nov 2012 20:36:24 +0100
Local: Tues, Nov 13 2012 2:36 pm
Subject: Re: [api-craft] Need help naming endpoints for email and username availability

I'm assuming you already have an end point for users, like /users and
/user/<nickname> ?  If so, what I'm used to do in these cases is simply use
the url /user/nickname?noOp=true (no-op meaning 'no operation'). On an
application level I can keep the validation in sync, by definition. Also, I
personally consider this to be pretty restful, although I am interested in
what others would do.

Dolf


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
PJD1328  
View profile  
 More options Nov 13 2012, 4:57 pm
From: PJD1328 <desai.prak...@gmail.com>
Date: Tue, 13 Nov 2012 13:57:47 -0800 (PST)
Local: Tues, Nov 13 2012 4:57 pm
Subject: Re: Need help naming endpoints for email and username availability

This is more of business or domain service than resource. So in this case i
would do something like below

GET /services/checkAvailibility?username=XXXX
GET /services/checkAvailibility?email=XXXX
GET /services/checkAvailibility?username=XXXX&email=YYY

That way you can add more parameters if you need to and you can have few
more capabilities in future.

I am open to feedback or suggestions.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike Kelly  
View profile  
 More options Nov 14 2012, 3:05 am
From: Mike Kelly <mikekelly...@gmail.com>
Date: Wed, 14 Nov 2012 08:05:34 +0000
Local: Wed, Nov 14 2012 3:05 am
Subject: Re: [api-craft] Need help naming endpoints for email and username availability

HEAD /users?email=...@bar.com
HEAD /users/dave

200 if taken, 204 if available

On 13 Nov 2012, at 19:33, Bryan Donovan <brdono...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kristof Kotai  
View profile  
 More options Nov 14 2012, 8:37 am
From: Kristof Kotai <kotai.kris...@gmail.com>
Date: Wed, 14 Nov 2012 05:37:36 -0800 (PST)
Local: Wed, Nov 14 2012 8:37 am
Subject: Re: [api-craft] Need help naming endpoints for email and username availability

I would do something similar to what Mike wrote. So

GET    /users

would return a list of users. Normally, you would add the number of results
in the header as well. How do you search amongst them? Like this:

GET    /users/?field=value&field2=value...

So if the number of results is in the header, then using this:

HEAD    /users/?field=value&field2=value...

where the number of results in the header is 0 / not 0 should solve the
problem.
I would only recommend this:

HEAD    /users/dave

If the "dave" identifier would be the primary key in the DB.
The HEAD solution is I think the strictly RESTful way of doing it.
Others, like Foursquare use "actions" on resources, that's a bit mroe
straightforward. Like
https://developer.foursquare.com/docs/users/search
So you would have something like this then:

GET    /users/exists/?email=...@email.com
GET    /users/exists/?username=kevin

Which would only return 200 if it exists, 404 if it doesn't. No body.

Kristof


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bryan Donovan  
View profile  
 More options Nov 15 2012, 3:59 pm
From: Bryan Donovan <brdono...@gmail.com>
Date: Thu, 15 Nov 2012 12:58:53 -0800
Local: Thurs, Nov 15 2012 3:58 pm
Subject: Re: [api-craft] Need help naming endpoints for email and username availability

Thanks for all the suggestions! I'll have to think about this a bit, but I'm leaning toward something like GET /users?username=foo, or using HEAD.

Sent from an iPhone.

On Nov 13, 2012, at 11:33 AM, Bryan Donovan <brdono...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dietrich Schulten  
View profile  
 More options Nov 18 2012, 2:10 am
From: Dietrich Schulten <dietrich.schul...@googlemail.com>
Date: Sun, 18 Nov 2012 08:10:05 +0100
Local: Sun, Nov 18 2012 2:10 am
Subject: Re: [api-craft] Need help naming endpoints for email and username availability

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
Am 15.11.2012 21:59 schrieb "Bryan Donovan" <brdono...@gmail.com>:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bryan Donovan  
View profile  
 More options Nov 19 2012, 12:07 pm
From: Bryan Donovan <brdono...@gmail.com>
Date: Mon, 19 Nov 2012 09:07:42 -0800
Local: Mon, Nov 19 2012 12:07 pm
Subject: Re: [api-craft] Need help naming endpoints for email and username availability

Thanks Dietrich, this might be something we will need to do. Good advice.

On Nov 17, 2012, at 11:10 PM, Dietrich Schulten wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »