Get gallery images
Overview
Get the business's gallery images.
Use this to display them.
You'll need the account's company_id and the gallery type.
Returns the images: only active ones, newest first. With type=partners you get every image, inside data. With type=campaign you get one page of images (per_page, page), not wrapped, with links and meta.
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
GET /api/v1/account/images/get
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
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
company_id | query | integer | Yes | The account. Must exist and be inside your account tree. |
type | query | string | Yes | Which gallery: partners or campaign. |
per_page | query | integer | No | type=campaign only. Images per page, 10–100 (values below 10 are raised to 10; above 100 returns 422). Default 10. |
page | query | integer | No | type=campaign only. Page number. Default 1. |
Request body
None.
Request payload
None.
Response body
There are two shapes.
type=partners: the payload is insidedata:data.statusanddata.data(the images).type=campaign: not wrapped.datais the page of images, next tolinksandmeta.
Each image has the same fields.
| Field | Type | Description |
|---|---|---|
data.status | string | type=partners. success. |
data.data | array of objects | type=partners. The images (fields below). An empty array [] when there are none. |
data[] | array of objects | type=campaign. The images on this page, with the same fields as data.data[]. |
data.data[].id | integer | The image's id. Use it as image_id in Delete a gallery image. |
data.data[].name | string or null | The uploaded file's name (characters other than letters, digits, _, . and - become _). |
data.data[].type | string | partners or campaign. |
data.data[].status | string | active. |
data.data[].path | string or null | The image's URL. |
links | object | type=campaign. first, last, prev and next page URLs. |
meta | object | type=campaign. Pagination: current_page, from, last_page, links, path, per_page, to, total. |
Response payload
{
"data": {
"status": "success",
"data": [
{
"id": 12,
"name": "partner_logo.png",
"type": "partners",
"status": "active",
"path": "https://d2ny6zb7otrnhl.cloudfront.net/account/images/partners/FJFBuzyn5khSrvAaJPN9IgKUsWfGQjXC9fw6SBhV.png"
}
]
}
}Examples
Success payload
type=partners: see Response payload.
With type=campaign, a page of images:
{
"data": [
{
"id": 8,
"name": "campaign_banner.png",
"type": "campaign",
"status": "active",
"path": "https://d2ny6zb7otrnhl.cloudfront.net/account/images/campaign/Xy7Pq2Lm9Nb4Vc1Zt8Rs3Kd6Wf0Gh5Ja.png"
}
],
"links": {
"first": "https://production-api.shoutaboutus.com/api/v1/account/images/get?page=1",
"last": "https://production-api.shoutaboutus.com/api/v1/account/images/get?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"page": null,
"active": false
},
{
"url": "https://production-api.shoutaboutus.com/api/v1/account/images/get?page=1",
"label": "1",
"page": 1,
"active": true
},
{
"url": null,
"label": "Next »",
"page": null,
"active": false
}
],
"path": "https://production-api.shoutaboutus.com/api/v1/account/images/get",
"per_page": 10,
"to": 1,
"total": 1
}
}Error payload
422 type is missing
{
"message": "The type field is required.",
"errors": {
"type": [
"The type field is required."
]
}
}422 company_id is missing
{
"message": "The company id field is required.",
"errors": {
"company_id": [
"The company id 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."
]
}
}422 per_page is above 100
{
"message": "The per page field must not be greater than 100.",
"errors": {
"per_page": [
"The per page field must not be greater than 100."
]
}
}| Status | Meaning |
|---|---|
200 | The active images. |
401 | The token is missing, expired or invalid. |
422 | company_id or type is missing or not allowed, company_id is outside your tree, or per_page is above 100. |
500 | Unexpected server error. |
Example request
curl --request GET \
--url "https://production-api.shoutaboutus.com/api/v1/account/images/get?company_id=5994&type=partners" \
--header 'Authorization: Bearer <bearer-token>' \
--header 'Accept: application/json'Updated 17 days ago
Did this page help you?
