createdIds
example
#396
-
Hi, I see Namely, there is no example of how a batch requests may reference a createdId. Can someone provide an example using Also, while I understand a table/map lookup for IDs yields better performance than reference lookups, I don't get what this feature does that using a E.g. how would referencing a createdId be different than just using a |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Here is an example of an email sent request/response. |
Beta Was this translation helpful? Give feedback.
-
There seem to be 2 different questions here. The first one is why do creation id references exist in addition to ResultReferences. The answer to that is because they can be used in different places. You can only use a ResultReference to do a simple syntactical replacement of a top-level argument to a function, while a creation id can be used anywhere the real id can be used. The 2nd question is why can you pass in a |
Beta Was this translation helpful? Give feedback.
-
Assume createdIds as a temporary ID generated by the client app. Each JMAP call after that should use the server ID for "update" or "delete," etc. This is the way for the server to return a stable immutable ID and not rely on some ill generated client ID. Yes, createdIds could be anything by RFC. |
Beta Was this translation helpful? Give feedback.
Assume createdIds as a temporary ID generated by the client app.
If you pay a bit more attention to the response.json, the client ID "aefe" is not replaced by the server ID "S1416". They both exist in the response.
But if you make more than one create object, this is the way to know how to map both ids!
Each JMAP call after that should use the server ID for "update" or "delete," etc.
This is the way for the server to return a stable immutable ID and not rely on some ill generated client ID.
Then, all subsequent calls could be stable as both client and server use one stable ID. Just take a look on IMAP Plus, etc extensions mess.
Yes, createdIds could be anything by RFC.
By providing create…