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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:42:03+00:00 2026-05-23T17:42:03+00:00

In our system we have accounts which contain items. An item is always associated

  • 0

In our system we have accounts which contain items. An item is always associated with a single account but also has a globally unique id in the system. Sometimes it is desirable to work with an item when only its id is known.

Is it incorrect to allow access to a subordinate resource (the item) from outside it’s owner (the account)? In other words, is it wrong to have 2 URI’s to the same resource? This is a little tricky to explain so here is an example:

POST /inventory/accountId
  #Request Body contains new item 
  #Response body contains new item's id

GET|PUT|DELETE /inventory/accountId/guid  #obviously works and makes sense

GET|PUT|DELETE /inventory/guid  #does this make sense?

Perhaps I should rethink my resource layout and not use accounts to create items but instead take the account as a query string parameter or field on the item?

POST /inventory
  # Request body contains item w/ account name set on it

GET|POST|DELETE /inventory/uuid  #makes sense

GET|POST|DELETE /inventory/accountId/uuid #not allowed
  • 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-05-23T17:42:04+00:00Added an answer on May 23, 2026 at 5:42 pm
    POST /inventory/accountId
    GET|PUT|DELETE /inventory/accountId/guid  #obviously works and makes sense
    GET|PUT|DELETE /inventory/guid  #does this make sense?
    

    It makes the most sense when /inventory/guid redirects to /inventory/accountId/guid (or, I’d argue, vice-versa). Having a single canonical entity, with multiple URI’s redirecting to it, allows your caching scheme to remain the most straightforward. If the two URI’s instead return the same data, then a user is inevitably going to PUT a new representation to one and then be confused when it GETs an old copy from the other because the cache was only invalidated for the former. A similar problem can occur for subsequent GETs on the two. Redirects keep that a lot cleaner (not perfectly synchronous, but cleaner).

    Whether to make items subordinate to accounts depends on whether items can exist without an account. If the data of an item is a subset of the data of an account, then go ahead and make it subordinate. If you find that an account is just one kind of container, or that some items exist without any container, then promote them to the top level.

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

Sidebar

Related Questions

I have a site 'accounts' table which contains account details for all our users.
In our system we have an entity Product , which might have various custom
Our in-house built CMS system has the ability to have descriptive url ( Descriptive
I am using an Account Controller which doesnt have its own table but uses
In our system, we have URLs for pages where the content, including the title,
I have a process where an incoming user request to our system is being
While debugging an issue with our system, I have discovered a thread contention that
I have a problem with a client, who cannot log in to our system.
We have a system where our front end is either a Rich Client application
I have a library that interacts with our phone system, ie, Hey phone, call

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.