Save how-it-works block
Overview
Replace the 'how it works' blocks for an account. Deletes all existing blocks for the given company_id + type, then inserts the supplied blocks. Each block's image may be an existing URL (stored as-is) or a data:image/.base64.. data URI. A data URI is decoded and uploaded to S3 (how-it-works/<uniqid>.<ext>), with the resulting public URL stored as image_url.
Prerequisites
- A bearer token. Callable with Partner and Account tokens.
Base URL
| Environment | URL |
|---|---|
| Production | https://production-api.shoutaboutus.com |
| Development | https://development-api.shoutaboutus.com |
Endpoint
POST /api/v1/account/faq/block
Authentication
-
Requires a bearer token in the
Authorization: Bearer <bearer-token>header. -
Who can call it: Partner and Account tokens.
-
Target company comes from the
company_idbody field. There is no ownership/partner-tree scoping, so any authenticated Partner or Account user can write blocks for any company id. -
Role only changes which
company_idyou pass.
Rate limit
- No rate limit.
Request body
- Body:
| Field | Type | Required | Description |
|---|---|---|---|
company_id | integer | required | Must be an existing account. |
type | string | optional (nullable) | One of landing_page, widget. Used both for the pre-delete scope and stored on each row; if omitted, rows are deleted/saved with type = null. |
howItWorks | array | required | Full replacement set of blocks. |
howItWorks.*.content | string | required | HTML content of the block. |
howItWorks.*.image | string | required | Existing URL (stored verbatim) or a base64 data:image/. URI (decoded + uploaded to S3). |
howItWorks.*.imageDirection | string | required | One of left, right. |
{
"company_id": 42,
"type": "landing_page",
"howItWorks": [
{
"content": "<p>Step one: leave a review.</p>",
"image": "https://example.com/existing.png",
"imageDirection": "left"
},
{
"content": "<p>Step two: get a response.</p>",
"image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==",
"imageDirection": "right"
}
]
}Response
data.status(string) — literal"success".data.message(string) —"Block content saved successfully".
200 OK · 200
200{
"data": {
"status": "success",
"message": "Block content saved successfully"
}
}422 Validation error · 422
422{
"message": "The how it works field is required.",
"errors": {
"howItWorks": ["The how it works field is required."],
"howItWorks.0.imageDirection": ["The selected how it works.0.image direction is invalid."]
}
}Errors
| Status | Meaning |
|---|---|
401 | The bearer token is missing, expired or invalid |
422 | Validation error |
500 | Unexpected server error |
Example request
curl --request POST \
--url "https://production-api.shoutaboutus.com/api/v1/account/faq/block" \
--header 'Authorization: Bearer <bearer-token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"company_id": 42, "type": "landing_page", "howItWorks": [{"content": "<p>Step one: leave a review.</p>", "image": "https://example.com/existing.png", "imageDirection": "left"}, {"content": "<p>Step two: get a response.</p>", "image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==", "imageDirection": "right"}]}'Updated 10 days ago
