liveBook · Manning

Import request identifier

As explained in API Design Patterns

An import request identifier is a globally unique value assigned to an imported record so repeated attempts can be recognized as the same record.

An import request identifier is a globally unique value assigned to each resource created during an import. The service caches it when first seen and discards later attempts with the same identifier, preventing duplicate resources when failed imports are retried. section 23.3.7

Use the identifier when transactional guarantees are unavailable or impractical:

  • Assign one importRequestId to every imported record, rather than relying on the resource ID, which may be ignored during import. section 23.3.7
  • Cache identifiers after first creation and reject or discard later records carrying an identifier already seen. section 23.3.7
  • Consider injecting identifiers into exported data so the same records can be re-imported safely. section 23.3.7

Deduplicating imported resources

An import can carry records such as { importRequestId: "abc", sender: "users/1", content: "hi" }. Retrying the record with identifier "abc" lets the API recognize it as already processed instead of creating another resource. section 23.3.7

Listing 23.7 Some sample JSON resources with import request IDs for deduplication
{ importRequestId: "abc", sender: "users/1", content: "hi" }        #1
{ importRequestId: "def", sender: "users/2", content: "hi back" }

Review sample JSON resource entries that pair importRequestId values with resource fields. section 23.3.7

How API Design Patterns covers it

How deep it goes
Explains per-record assignment, caching, duplicate rejection, and export injection, but does not specify cache implementation.
Examples
Uses JSON records containing importRequestId, sender, and content to demonstrate retry deduplication.
What it assumes
Assumes understanding of imports, exports, resource IDs, retries, and transactional storage limitations.
What you can do after
Apply per-record identifiers to design retry-safe imports and optional export preservation.
How it connects
Connects request deduplication, transactions, resource IDs, and import/export configuration.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of API Design Patterns. The section links point to the parts of the book it draws on.