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 8525057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:51:51+00:00 2026-06-11T07:51:51+00:00

What is a correct rest way of getting a resource ID by a field,

  • 0

What is a correct rest way of getting a resource ID by a field, for example a name. Take a look at the following operations:

GET /users/mike-thomas
GET /users/rick-astley

I don’t want to use these operations at my API end, instead I want to write an API operation that will get me the ID when submitting a field (name in the case of users) for example:

GET /users/id-by-field

Submitted data:

{
  "fullName": "Mike Thomas"
}

Return data:

{
  "data": {
    "id": "123456789012345678901234"
  }
}
  • 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-11T07:51:53+00:00Added an answer on June 11, 2026 at 7:51 am

    What you want is known as an algorithmic URL where the parameters for the algorithm are passed as URL parameters:

    GET /users?name="Mike Thomas"
    

    Advantages are that you are using the “root” resource (users) and the search parameters are easily extended without having to change anything in the routing. For example:

    GET /users?text="Mike"&year=1962&gender=M
    

    where text would be searched for in more than just the name.

    The resultant data would be a list of users and could return more than the identification of those users. Unless fullName uniquely identifies users, that is what you need to allow for anyway. And of course the list could contain a single user if the parameters uniquely identified that user.

    {
      users: [
        {
          id: "123456789012345678901234",
          fullName: "Mike Thomas",
          dateJoined: 19620228
        }
      , {
          id: "234567890123456789012345"
          fullName: "Rick Astley",
          dateJoined: 19620227
        }
      ]
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use Angular $resource for REST service. Due to the quirk in my get
Most REST tutorials arranged resources as following: GET /car/ -> list of cars GET
im not sure of which way to take with a REST API im currently
Correct me If Im wrong. public class Person{ List<Cars> myCars; //Get and Set }
please correct the program. Q. Write a java prg to accept RollNo, Name of
How would you correct way to handle an exception in this situation? Initially I
Is it the correct syntax? The map contains more than one value and getting
I have a REST service that gets a GET request, and I want it
I was looking for the best way to store the users' passwords, but I'm
I'm probably going about this the wrong way, please feel free to correct me.

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.