I am currently working on a web app and want to design the interface between nodejs / mongoose and the backbone app.

A short description of the app: A user signs up to the application and gets a user account where he can create an organization (e.g. footballclub). Within these organizations you can set up projects. Within these projects you can define tasks you could assign to somebody)

I want to have a RESTful api for the app. My problem is: A user could have more than one organization, if i have an api for projects like

GET /projects/
POST /projects/
GET /projects/:id
PUT /projects/:id
DELETE /projects/:id

How do i determine to which organization the project belongs? Do i add a parameter to the api or do i send an extra field containing the id of the organization? Any help is appreciated!


GET /organizations/projects/:id

Gets a list of projects for an organization.

POST /projects/:id

Updates a specific project.

GET /projects/:id

Gets a specific project.

DELETE /projects/:id

Deletes a specific project.

DELETE /organizations/:id

Deletes an organization and all it's projects.

POST /organizations/:id

Updates a specific organization.

GET /organizations

Gets a list of all organizations

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.