Resource permission entries: resource_id patterns, methods and version ranges
Key Takeaway
OCAPI allows nothing by default, so every call a client makes needs a matching resource entry. A subresource such as /products/*/images is a separate resource from its base resource /products/*, so it needs its own entry.
OCAPI client permissions are JSON entries in Business Manager that say which API resources a client application may call. Each entry also says which HTTP methods the client may use and, optionally, which OCAPI versions the entry applies to. Whether a client's calls succeed or fail depends on these entries.
How to configure OCAPI permissions
- In Business Manager, go to "Administration > Site Development > Open Commerce API Settings".
- Select the API type, such as Shop or Data.
- Select a context: "Global" for all sites, or the name of one site.
- Edit the JSON document.
- Click "Save".
Saved settings are cached for up to three minutes before they take effect, so a new permission may not work right away.
Permissions can be global or site-specific. For a specific site, you can override the global settings for a client ID. Most Data API resources are organization-specific, so they support only global client permissions.