#Nested Resources, REST endpoints

1 messages · Page 1 of 1 (latest)

sleek cipher
#

Hey i came across this interesting question, regarding creating nested endpoints. The OP asks for better ways to do it, there's both types of responses to the post. What are your thoughts?

modest bluffBOT
#

<@&1004656351647117403> please have a look, thanks.

modest bluffBOT
#

While you are waiting for getting help, here are some tips to improve your experience:

Code is much easier to read if posted with syntax highlighting and proper formatting.

If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.

Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.

sleek cipher
modest bluffBOT
#

Closed the thread due to inactivity.

If your question was not resolved yet, feel free to just post a message to reopen it, or create a new thread. But try to improve the quality of your question to make it easier to help you 👍

sleek cipher
#

.

sleek cipher
#

Here's more information regarding this, suppose there's a hierarchy between resources ex: a bank, accountHolder, account

#

so if i wanted to do a request to grab an account with id 1, using nested endpoints it would look something like

#

/bank/accountHolders/{accountHolderId}/accounts/{accountId}

#

whereas another possible scenario is making non-nested endpoints

#

/accounts/{accountId}

#

in the second scenario, all the tasks related to accounts will be covered by /accounts bas base url, same for /accountHolders and so on

#

this is considering the resources share a sort of hierarchal relationship