Widgets
Retrieve a widget
Returns one widget by its id.
GET/widgets/{widget_id}
Handling a missing widget
A 404 is a normal answer, not a failure of the request. Treat it as a value:
the widget is not there. It does not mean the API key is wrong, which is a 401.
status=$(curl -s -o body.json -w '%{http_code}' \
"https://api.example.com/v1/widgets/$WIDGET_ID" \
-H "Authorization: Bearer $API_KEY")
case "$status" in
200) jq -r '.name' body.json ;;
404) echo "gone" ;;
*) jq -r '.error.code' body.json; exit 1 ;;
esacAuthorizations
Authorizationbearerin headerrequiredPath parameters
widget_idstringrequiredThe widget id, returned when the widget was created.
Response
The widget.
idstringrequiredUnique and immutable.
namestringrequireddescriptionstringstatusenum<string>requiredone of: draft, active, archivedA widget is only served to callers while it is active.
tagsstring[]created_atstring<date-time>requiredRFC 3339, always UTC.
The API key is missing, malformed or revoked.
errorobjectrequiredNo widget with this id exists.
errorobjectrequired