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

Base URL

EnvironmentURL
Productionhttps://production-api.shoutaboutus.com
Developmenthttps://development-api.shoutaboutus.com

Endpoint

POST /api/v1/account/faq/block

Authentication

Partner or Account token

  • company_id must 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

FieldTypeRequiredDescription
company_idintegerYesThe account. Must exist and be inside your account tree.
typestringYesWhich page the blocks are for: landing_page or widget.
howItWorksarray of objectsYesThe full list of blocks, at least one. Replaces the saved list.
howItWorks[].contentstringYesThe block's content, as HTML.
howItWorks[].imagestringYesAn image URL (kept as is) or a base64 data:image/...;base64,... URL (uploaded; the block stores its URL).
howItWorks[].imageDirectionstringYesWhich 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.

FieldTypeDescription
statusstringsuccess.
messagestringBlock 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."
    ]
  }
}
StatusMeaning
200The blocks were saved.
401The token is missing, expired or invalid.
422howItWorks 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.
500Unexpected 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"}]}'

Did this page help you?