Upload gallery images

Overview

Add images to the business's gallery.

Use this to build a photo gallery.

You'll need the image files.

Returns the uploaded images. Send the request as multipart/form-data, with one images[] part per file.

Prerequisites

  • A bearer token. See Authentication.
  • The account's id (company_id).
  • JPEG or PNG files, up to 2048 KB each.

Base URL

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

Endpoint

POST /api/v1/account/images/save

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

Sent as multipart/form-data.

FieldTypeRequiredDescription
company_idintegerYesThe account. Must exist and be inside your account tree.
typestringYesWhich gallery: partners or campaign.
images[]file (one or more)YesOne or more image files. Each must be a JPEG or PNG, at most 2048 KB.
statusstringNoactive (default) or inactive. Only active images are listed by Get gallery images.

Request payload

Form fields:

company_id=5994
type=partners
images[]=@images/partner_logo.png

Response body

The payload is inside data.

FieldTypeDescription
statusstringsuccess.
messagestringLogos saved successfully!.
dataarray of objectsOne entry per uploaded image.
data[].idintegerThe image's id. Use it as image_id in Delete a gallery image.
data[].namestring or nullThe uploaded file's name (characters other than letters, digits, _, . and - become _).
data[].typestringpartners or campaign.
data[].statusstringactive, or the status you sent.
data[].pathstring or nullThe image's URL.

Response payload

{
  "data": {
    "status": "success",
    "message": "Logos saved successfully!",
    "data": [
      {
        "id": 12,
        "name": "partner_logo.png",
        "type": "partners",
        "status": "active",
        "path": "https://d2ny6zb7otrnhl.cloudfront.net/account/images/partners/FJFBuzyn5khSrvAaJPN9IgKUsWfGQjXC9fw6SBhV.png"
      }
    ]
  }
}

Examples

Success payload

See Response payload.

Error payload

422 type or images missing

{
  "message": "The type field is required. (and 1 more error)",
  "errors": {
    "type": [
      "The type field is required."
    ],
    "images": [
      "The images field is required."
    ]
  }
}

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 images were uploaded.
401The token is missing, expired or invalid.
422A required field is missing, a file isn't a JPEG or PNG or is over 2048 KB, or company_id doesn't exist or is outside your tree.
500Unexpected server error, or a file couldn't be stored.

Example request

curl --request POST \
  --url "https://production-api.shoutaboutus.com/api/v1/account/images/save" \
  --header 'Authorization: Bearer <bearer-token>' \
  --header 'Accept: application/json' \
  --form 'company_id=5994' \
  --form 'type=partners' \
  --form 'images[]=@images/partner_logo.png'

Did this page help you?