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
- An Account bearer token. See Authentication.
- The report's
report_id, from List scheduled reports.
Base URL
| Environment | URL |
|---|---|
| Production | https://production-api.shoutaboutus.com |
| Development | https://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_idsmust be inside your account; anything else is rejected with422. - The report type and recipient can't be changed here.
Rate limit
This endpoint has no rate limit.
Request parameters
None.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
report_id | integer | Yes | The report to change. Must exist and be inside your account. |
reportPeriodType | string | Yes | How 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_store | integer | Yes | 1 to cover every location, 0 to cover only the locations in store_ids. |
store_ids | array of integers | When all_store is 0 | Location 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.
| Field | Type | Description |
|---|---|---|
status | string | success. |
response | string | The 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."
]
}
}| Status | Meaning |
|---|---|
200 | The schedule is updated. |
401 | The token is missing, expired or invalid. |
403 | The token isn't an Account token. |
422 | A required field is missing, or the report or a location doesn't exist or is outside your account. |
500 | Unexpected 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]}'Updated 17 days ago
Did this page help you?
