You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
-
3There is no right answer to this. Ask your consumers what they want. Will they always/sometimes/rarely need the additional fields? Whats the overhead on the response time and response size for including the additional fields? Do you have the bandwidth or desire to build/maintain multiple apis? You could build two endpoints, one for just event, one with evetything (not particularly RESTful, but if it meets the consumer needs..). So many ways to chop this up. Figure out the consumer's requirements by priority, figure out your own priorities and come to a decision/compramise.– K MoCommented Mar 1, 2020 at 11:24
-
1"I know that the person making the request needs the information" -- if can you tell this, then why would you force the person to make multiple calls?– Erik EidtCommented Mar 1, 2020 at 12:32
-
1Over the network, generally prefer to transfer data in a coarse grained way (more data at once), as the cost of making the call can accumulate over multiple calls and outweigh the cost of transfer (higher overall latency). However, take into consideration what data they actually need and when, under what scenarios, how are they going to use it (access patterns), consider paging, etc., and organize the API around that. It's a bit of a balancing act.– Filip MilovanovićCommented Mar 1, 2020 at 14:33
-
To add to the other comments, the objects that you transmit over your API should be driven by the requirements of your API consumers, not how you happen to currently store the required information in your database. It is entirely valid to send an object that is built from information that is stored across multiple database tables.– Bart van Ingen SchenauCommented Mar 2, 2020 at 9:24
Add a comment
|
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
-
create code fences with backticks ` or tildes ~
```
like so
``` -
add language identifier to highlight code
```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_`
- quote by placing > at start of line
- to make links (use https whenever possible)
<https://example.com>
[example](https://example.com)
<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. design-patterns), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you