I'm trying to create a new version of Dazah's API to be fully RESTful. To that end, I'm following the article at: http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api

I understand that it's bad practice to have endpoints that are verbs, and you should always use nouns. But what would an endpoint look like to join a group?

GET /groups <= list of groups
GET /groups/1 <= group #1
GET /groups/members <= list of group members
POST /groups/members <= join group?? I'm not actually creating a new member here. I'm just adding myself to the collection of group members.

Perhaps what I am doing, however, is creating a new membership record?
GET /groups/memberships
POST /groups/memberships

Perhaps what I am doing, however, is creating a new membership record?

This is correct, but when you're posting to /groups/memberships, to which group are you adding a member?

I'd expect to see something more like this. Of course, you don't need all of these actions (i.e. updating a membership, which is probably just a record in a link table, might not be necessary) but it's obvious at every point what each action does.

GET    /groups/                                     get a list of all groups
POST   /groups/                                     create a new group
GET    /groups/:group_id                            get an individual group :group_id
PUT    /groups/:group_id                            replace group :group_id
PATCH  /groups/:group_id                            modify group :group_id
DELETE /groups/:group_id                            delete group :group_id

GET    /groups/:group_id/memberships                get a list of members for group :group_id
POST   /groups/:group_id/memberships                create a new membership for the group (i.e. add a member)
GET    /groups/:group_id/memberships/:member_id     get an individual membership :member_id for group :group_id
PUT    /groups/:group_id/memberships/:member_id     replace membership :member_id
PATCH  /groups/:group_id/memberships/:member_id     modify membership :member_id
DELETE /groups/:group_id/memberships/:member_id     remove membership :member_id from group :group_id

Also, it would appear that your Markdown implementation doesn't support tables! :)

Edited 1 Week Ago by pty: Spelling

Incidentally, in my earlier post, I used Rails-esque route notation :group_id and :membership_id. In case it's not obvious, that's where your identifiers would go, so the actual path would be /groups/1/memberships/3 (or if you prefer slugs, /groups/admin/memberships/joey)

My apologies! I accidentally left out the :id from the URI in my question. I had meant to include it.

Yes, we purposefully don't support tables.

Yes, we purposefully don't support tables.

Ah, what's the reasoning behind that? It doesn't need to be provided by the editor, but in some cases it makes a post much easier to read.

There was a reason back when we first switched to Markdown from BBCode and I forget specifically what it is. I think it either had something to do with backwards compatibility or it fubar'ing up too many posts. I think it might also be related to the Markdown parser we were using at the time. It was so many years ago, I unfortunately don't recall. And this is the first time in all those years that anyone's ever missed it.

Dani what are you really doing ? Where is the WSDL that will describe those services ?