Download a sample file

Overview

Get the sample file saved with a file format.

Use this to build your export to match.

You'll need the mapping id.

Returns the file's URL, name, size and type; download the file from file_path.

Prerequisites

  • A bearer token. See Authentication.
  • The file format's id (fileHeaderId), from Define a file format or Get a campaign's file format.

Base URL

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

Endpoint

GET /api/v1/campaign/automate/file-headers/{fileHeaderId}/sample-file

Authentication

Account token

  • The file format's campaign must be an automation campaign in your own account; otherwise 403.

Rate limit

This endpoint has no rate limit.

Request parameters

ParameterInTypeRequiredDescription
fileHeaderIdpathintegerYesThe file format id (data.id from Define a file format). Digits only.

Request body

None.

Request payload

None.

Response body

The payload is inside data.

FieldTypeDescription
statusstringsuccess.
dataobjectThe sample file.
data.file_pathstringURL to download the file from.
data.file_namestringThe file's name.
data.file_sizeintegerSize in bytes.
data.file_typestringThe file's MIME type.

Response payload

{
  "data": {
    "status": "success",
    "data": {
      "file_path": "https://d2ny6zb7otrnhl.cloudfront.net/campaign_automation/sample_files/1718447400_sample.xlsx",
      "file_name": "1718447400_sample.xlsx",
      "file_size": 10240,
      "file_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
    }
  }
}

Examples

Success payload

See Response payload.

Error payload

403 Not your file format

{
  "message": "Not authorized to access this sample file",
  "status": "error",
  "errors": []
}

404 File format not found

{
  "message": "File header configuration not found",
  "status": "error",
  "errors": []
}

404 Sample file not found

{
  "message": "Sample file not found",
  "status": "error",
  "errors": []
}
StatusMeaning
200The sample file's details.
401The token is missing, expired or invalid.
403The file format's campaign isn't an automation campaign in your account.
404No file format has that id, or its sample file no longer exists.
500Unexpected server error.

Example request

curl --request GET \
  --url "https://production-api.shoutaboutus.com/api/v1/campaign/automate/file-headers/4/sample-file" \
  --header 'Authorization: Bearer <bearer-token>' \
  --header 'Accept: application/json'

Did this page help you?