Get a gateway's icon image
const url = 'https://api.nsin.ir/gateway-presets/1/icon';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.nsin.ir/gateway-presets/1/iconThe icon of one catalog gateway, as image bytes. You normally reach it
through the icon_url that GET /domains/{domain}/gateways/?icons=url
returns (a path on the API origin, with the version already in ?v=)
instead of the inline base64 icon.
Public — no authentication, so an <img> tag can load it: catalog
icons are not secret. The URL is content-addressed: when v names the
current icon the response may be cached for a year (immutable). An
old or missing v still gets the current icon, but on a short
lifetime, so a stale URL never pins a stale picture. ETag is the
version; send it back in If-None-Match for a 304.
The body is PNG, JPEG, GIF, WebP or SVG. SVG is served with a
sandboxing Content-Security-Policy, so it can only be drawn.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Numeric id of the gateway (the id of a gateway list item).
Query Parameters
Section titled “Query Parameters ”The icon version from icon_url. Optional; see above.
Responses
Section titled “ Responses ”The icon.
Headers
Section titled “Headers ”public, max-age=31536000, immutable when v is the current
version; public, max-age=300, must-revalidate or no-cache
otherwise.
The icon version, quoted.
If-None-Match matches the current version.
No such gateway, or it has no icon. Empty body.