Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8576405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:55:00+00:00 2026-06-11T19:55:00+00:00

I have the following functionality at my API and I strumbled upon a few

  • 0

I have the following functionality at my API and I strumbled upon a few questions:

  1. POST /user (requires fullName, email, password) will create a new user, if the user has been created an unique activation ID is generated and a link to activate the account is send through mail to the user.

  2. PUT /user (requires id, email) will activate the user.

Once the user has activated it’s account, it can login.

  1. POST /session (requires email, password) and logs in the user.
  2. GET /session will look at the cookie session id and return user info if auth.
  3. DELETE /session logs the user out.

Once the user is logged in, he is asked to submit their interests (just a HTML textarea) and they can submit a description about their account too (Location, gender, etc but it is all optional so also an HTML textarea just like Twitter account description)

Now my question is:

As you can see 2. PUT /user will activate the user, but how would I handle the submit interests and account description in a proper restful design?

Should I look at the point where at my backend server PUT /user will come in and detect the fields that where submitted?

Or would it make more sence to create a separated PUT /user/activate and PUT /user/interests.

Once this is finished, I want to expand it with restore password, also this would be a PUT /user wouldn’t the field detection at the server side will get kinda messy?

Now about backbone, this is my session model:

var Session = Backbone.Model.extend({
  url: '/session'
});

var session = new Session();
session.fetch(); // Get the user authentication of the backend server.

my user model:

var User = Backbone.Model.extend({
  url: '/user'
});

function signup(fullName, email, password){
  var user = new User();
  user.save({
    fullName: fullName,
    email: email,
    password: password
  });
};

function activate(id, activationId){
  var user = new User();
  user.save({
    id: id,
    activationId: activationId
  });
};

// Possibility...?
function submitInterests(id, interests){
  var user = new User(url: '/user/interests/');
  user.save({
    id: id,
    activationid: activationId
  });
}

Thank you for reading.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T19:55:01+00:00Added an answer on June 11, 2026 at 7:55 pm

    A rule of thumb in RESTful world is:

    Verbs down, nouns up.

    That’s because the magic 4 [GET, POST, PUT, DELETE] should be enough for all actions: no /users/activate / /user/edit stuff around.

    While making a PUT over the whole /users for activation may seem legit, so would be making all the requests to /root and passing “entity = users, id = 3, …” and so on.

    I advice you to use /entityname for the collection [where you can POST to create a new one], then /entityname/:id in order to refer to a single entity [in this case, a single user].

    Now you can make a PUT on /users/123 to accomplish whatever you need.


    Of course you can nest resources:

    /users/:id/interests
    

    This is the route for all interests of :id-th user – you can issue a GET over it to retrieve them all, or a POST to add an element to the list, a PUT to set all the list from scratch.


    One last thought about your session resource: a true RESTful service should be *stateless, i.e. it should not rely on session. Authorization has to be made on every request, see HTTP Basic Auth, though you can come with a session sometimes.

    To be consistent to your schema, you can define a /user/:id/sessions resource where you can POST in order to make a new login, so you can keep track of user accesses.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my site, I have implemented the following functionality: If the user clicks on
We are currently working on an iPad application which will have the following functionality:
I want the following functionality using php I have a csv file. Each file
Basically I have a new client that is after the following functionality from her
I have a web app that I would like to have the following functionality:
Is following thing possible?if yes how? I have some core functionality already implemented in
I have been coding up some map functionality. In the last few days, I
I have implemented the following functionality that connects to webservice and downloads a favicon
I have an accordion that I want to have the following functionality: when the
I have a series of functions that I want to have the following functionality.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.