Edit an account email report

Overview

Change an account user's scheduled report: how often it's sent and the locations it covers.

Use this when their needs change.

You'll need the report_id and the changes.

The schedule is updated.

Prerequisites

Base URL

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

Endpoint

POST /api/v1/user/reports/edit

Authentication

Account token

  • Only Account tokens can call it. Any other token gets 403 (This action is unauthorized.).
  • The report and every id in store_ids must be inside your account; anything else is rejected with 422.
  • The report type and recipient can't be changed here.

Rate limit

This endpoint has no rate limit.

Request parameters

None.

Request body

FieldTypeRequiredDescription
report_idintegerYesThe report to change. Must exist and be inside your account.
reportPeriodTypestringYesHow often to send it: day, week or month. It must fit the report's type, as when you scheduled it (for example month for an activity report).
all_storeintegerYes1 to cover every location, 0 to cover only the locations in store_ids.
store_idsarray of integersWhen all_store is 0Location ids to cover. Required when all_store is 0. Each must exist and be inside your account. Replaces the locations the report covered before.

Request payload

{
  "report_id": 5,
  "reportPeriodType": "month",
  "all_store": 0,
  "store_ids": [
    3007
  ]
}

Response body

The payload is inside data.

FieldTypeDescription
statusstringsuccess.
responsestringThe confirmation message, Report has been updated successfully!.

Response payload

{
  "data": {
    "status": "success",
    "response": "Report has been updated successfully!"
  }
}

Examples

Success payload

See Response payload.

Error payload

403 Not an Account token

{
  "message": "This action is unauthorized."
}

422 Report doesn't exist

An unknown report_id, sent with all_store 0 and no store_ids:

{
  "message": "The selected report id is invalid. (and 3 more errors)",
  "errors": {
    "report_id": [
      "The selected report id is invalid.",
      "The selected report id does not belong to your company hierarchy."
    ],
    "reportPeriodType": [
      "Invalid report type"
    ],
    "store_ids": [
      "The store ids field is required when all store is 0."
    ]
  }
}
StatusMeaning
200The schedule is updated.
401The token is missing, expired or invalid.
403The token isn't an Account token.
422A required field is missing, or the report or a location doesn't exist or is outside your account.
500Unexpected server error.

Example request

curl --request POST \
  --url "https://production-api.shoutaboutus.com/api/v1/user/reports/edit" \
  --header 'Authorization: Bearer <bearer-token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{"report_id": 5, "reportPeriodType": "month", "all_store": 0, "store_ids": [3007]}'

Did this page help you?