curl --request GET \
--url "https://cache.example.com/cache/messages/did%3Aopenpayload%3A1111111111111111111111/mobile-01" \
--header "X-Service-Id: did:openpayload:1111111111111111111111#cache" \
--header "X-Cache-Endpoint: https://cache.example.com" \
--header "X-Key-Id: did:openpayload:1111111111111111111111#signing" \
--header "X-Timestamp: <current-RFC3339-timestamp>" \
--header "X-Nonce: <unique-random-nonce>" \
--header "X-Signature: <base64-signature>"
Cache API
Get messages for a device
Retrieve encrypted envelopes targeted to one authorized device
curl --request GET \
--url "https://cache.example.com/cache/messages/did%3Aopenpayload%3A1111111111111111111111/mobile-01" \
--header "X-Service-Id: did:openpayload:1111111111111111111111#cache" \
--header "X-Cache-Endpoint: https://cache.example.com" \
--header "X-Key-Id: did:openpayload:1111111111111111111111#signing" \
--header "X-Timestamp: <current-RFC3339-timestamp>" \
--header "X-Nonce: <unique-random-nonce>" \
--header "X-Signature: <base64-signature>"
Use this endpoint when a DID has multiple registered devices and your client wants messages for one device. The device identifier is included in both the path and signed access proof.
The Cache verifies that the device is allowed by the resolved recipient record.
Send
Signed proof
Use the same format as Get cached messages, but populatedevice_id:
openpayload:cache:retrieval-proof:v1
operation=pull
did=did:openpayload:1111111111111111111111
device_id=mobile-01
service_id=did:openpayload:1111111111111111111111#cache
cache_endpoint=https://cache.example.com
key_id=did:openpayload:1111111111111111111111#signing
timestamp=<current-RFC3339-timestamp>
nonce=<unique-random-nonce>
subject=*
Request
string
required
Recipient DID.
string
required
Authorized device identifier.
X-Service-Id, X-Cache-Endpoint, X-Key-Id, X-Timestamp, X-Nonce, and X-Signature exactly as described by the recipient-wide retrieval endpoint.
curl --request GET \
--url "https://cache.example.com/cache/messages/did%3Aopenpayload%3A1111111111111111111111/mobile-01" \
--header "X-Service-Id: did:openpayload:1111111111111111111111#cache" \
--header "X-Cache-Endpoint: https://cache.example.com" \
--header "X-Key-Id: did:openpayload:1111111111111111111111#signing" \
--header "X-Timestamp: <current-RFC3339-timestamp>" \
--header "X-Nonce: <unique-random-nonce>" \
--header "X-Signature: <base64-signature>"
Response
The response hascount and messages, using the same message object as Get cached messages.
Straight to the point
GET /cache/messages/{did}/{deviceId}
- Proof operation:
pull - Proof subject:
* - Proof
device_id: exact path device - Unauthorized or tombstoned device:
403

