Skip to content
ShopentlyLearn

Read an available code or file

Read the content of a free stock unit. A code returns JSON; a file returns its bytes with the correct Content-Type.

GET/api/v1/inventory/products/{product_id}/digital-units/{unit_id}/content

cURL request

: "${SHOPENTLY_SHOP_URL:?}"

curl --disable --globoff --fail-with-body --silent --show-error \
  --proto '=https' --connect-timeout 5 --max-time 300 \
  --request GET \
  --header "Authorization: Bearer ${SHOPENTLY_ACCESS_TOKEN:?}" \
  --max-filesize 262144000 \
  --output "${SHOPENTLY_OUTPUT_FILE:?}" \
  --url "${SHOPENTLY_SHOP_URL%/}"/api/v1/inventory/products/example/digital-units/00000000-0000-4000-8000-000000000003/content

Response

{
  "data": {
    "code": "DEMO-ONE",
    "delivery_id": null,
    "kind": "code",
    "payload_id": "00000000-0000-4000-8000-000000000004",
    "unit_id": "00000000-0000-4000-8000-000000000003"
  },
  "meta": {
    "request_id": "example-request"
  }
}

Required permissions

Authentication
Access token
Available from
STANDARD
Key permission
Reveal pool codes and filesinventory.digital_unit:reveal