Save how-it-works content
Overview
Set an explanatory block on the hosted page.
Use this to edit it.
You'll need the block content.
It's saved. Each save replaces all of the account's blocks for that type, so send the full list (at least one). An image can be a URL, kept as is, or a base64 data:image/... URL, which is uploaded and replaced by its URL.
Prerequisites
- A bearer token. See Authentication.
- The account's id (
company_id).
Base URL
| Environment | URL |
|---|---|
| Production | https://production-api.shoutaboutus.com |
| Development | https://development-api.shoutaboutus.com |
Endpoint
POST /api/v1/account/faq/block
Authentication
Partner or Account token
company_idmust be inside your own account tree. A Partner token can use any account under the partner; an Account token only its own account.- An account outside your tree, or one that doesn't exist, is rejected with
422.
Rate limit
This endpoint has no rate limit.
Request parameters
None.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
company_id | integer | Yes | The account. Must exist and be inside your account tree. |
type | string | Yes | Which page the blocks are for: landing_page or widget. |
howItWorks | array of objects | Yes | The full list of blocks, at least one. Replaces the saved list. |
howItWorks[].content | string | Yes | The block's content, as HTML. |
howItWorks[].image | string | Yes | An image URL (kept as is) or a base64 data:image/...;base64,... URL (uploaded; the block stores its URL). |
howItWorks[].imageDirection | string | Yes | Which side the image is on: left or right. |
Request payload
{
"company_id": 5994,
"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 body
The payload is inside data.
| Field | Type | Description |
|---|---|---|
status | string | success. |
message | string | Block content saved successfully. |
Response payload
{
"data": {
"status": "success",
"message": "Block content saved successfully"
}
}Examples
Success payload
See Response payload.
Error payload
422 howItWorks is missing or empty
{
"message": "The how it works field is required.",
"errors": {
"howItWorks": [
"The how it works field is required."
]
}
}422 A block is missing an image or has the wrong imageDirection
{
"message": "The howItWorks.0.image field is required. (and 1 more error)",
"errors": {
"howItWorks.0.image": [
"The howItWorks.0.image field is required."
],
"howItWorks.0.imageDirection": [
"The selected howItWorks.0.imageDirection is invalid."
]
}
}422 A base64 image can't be read
{
"message": "The image must be a valid base64 data URL, for example data:image/png;base64,....",
"status": "error",
"errors": {
"howItWorks": [
"The image must be a valid base64 data URL, for example data:image/png;base64,...."
]
}
}422 Account outside your tree
{
"message": "The selected company id does not belong to your company hierarchy.",
"errors": {
"company_id": [
"The selected company id does not belong to your company hierarchy."
]
}
}| Status | Meaning |
|---|---|
200 | The blocks were saved. |
401 | The token is missing, expired or invalid. |
422 | howItWorks is missing or empty, a block is missing a field, imageDirection isn't left or right, a base64 image can't be read, or company_id is missing, doesn't exist or is outside your tree. |
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": 5994, "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 17 days ago
Did this page help you?
