Automated Reports
Endpoints for Automated Reports
Endpoints for Automated Reports
GET/api/v1/automated-reports
Authentication: Bearer token (JWT)
pagenumberOptional1minimum: 1takenumberOptional10minimum: 1maximum: 50orderBystringOptional"createdAt"Allowed values: "createdAt", "id", "updatedAt"orderDirectionstringOptional"desc"Allowed values: "asc", "desc"statusstringOptional"active", "draft"frequencystringOptional"monthly", "weekly", "daily"itemsarray of AutomatedReportResponseDtoRequired16 fieldsitemsidstringRequired when parent is presentField path: items[].idnamestringRequired when parent is presentField path: items[].namecurlcurl https://api.subrite.no/api/v1/automated-reports \
--header 'Authorization: Bearer <token>'POST/api/v1/automated-reports
Authentication: Bearer token (JWT)
application/jsonnamestringRequiredstatusstringOptional"draft"Allowed values: "active", "draft"frequencyGET/api/v1/automated-reports/{id}
Authentication: Bearer token (JWT)
idstringRequiredSame fields as Create a new automated report (201).
PUT/api/v1/automated-reports/{id}
Authentication: Bearer token (JWT)
idstringRequiredapplication/jsonnamestringOptionalstatusDELETE/api/v1/automated-reports/{id}
Authentication: Bearer token (JWT)
idstringRequiredReport deleted
This response has no body.
statusAutomatedReportStatusRequired when parent is presentField path: items[].status"active", "draft"frequencyAutomatedReportFrequencyRequired when parent is presentField path: items[].frequency"monthly", "weekly", "daily"cronExpressionstringRequired when parent is presentField path: items[].cronExpressionscheduleobjectField path: items[].schedulesendTimestringRequired when parent is presentField path: items[].sendTimerecipientUserIdsarray of stringField path: items[].recipientUserIdsexternalEmailsarray of stringField path: items[].externalEmailsselectedSectionsarray of AutomatedReportSectionRequired when parent is presentField path: items[].selectedSections"sales_statistics", "sales_by_reference", "mrr", "subscriptions", "cashflow", "consents", "consent_changes"includeDashboardLinkbooleanRequired when parent is presentField path: items[].includeDashboardLinklastSentstring (date-time)Field path: items[].lastSentnextScheduledAtstring (date-time)Field path: items[].nextScheduledAtcreatedAtstring (date-time)Required when parent is presentField path: items[].createdAtupdatedAtstring (date-time)Required when parent is presentField path: items[].updatedAtrecipientCountnumberRequired when parent is presentField path: items[].recipientCountmetaPageMetaRequired6 fieldsmetapagenumberRequiredField path: meta.pagetakenumberRequiredField path: meta.takecountnumberRequiredField path: meta.countpageCountnumberRequiredField path: meta.pageCounthasPreviousPagebooleanRequiredField path: meta.hasPreviousPagehasNextPagebooleanRequiredField path: meta.hasNextPage{
"items": [
{
"schedule": {},
"recipientUserIds": [],
"externalEmails": [],
"selectedSections": []
}
],
"meta": {
"page": 0,
"take": 0,
"count": 0,
"pageCount": 0,
"hasPreviousPage": true,
"hasNextPage": true
}
}unauthorized
This response has no body.
string"monthly"Allowed values: "monthly", "weekly", "daily"sendTimestringOptional"09:00"Send time in HH:mm formatpattern: /^([01]?[0-9]|2[0-3]):[0-5][0-9]$/recipientUserIdsarray of stringOptionalexternalEmailsarray of string (email)OptionalselectedSectionsarray of stringRequired"sales_statistics", "sales_by_reference", "mrr", "subscriptions", "cashflow", "consents", "consent_changes"includeDashboardLinkbooleanOptionaltrueInclude link to dashboard{
"name": "string",
"status": "active",
"frequency": "monthly",
"sendTime": "09:00",
"recipientUserIds": [
"string"
],
"externalEmails": [
"user@example.com"
],
"selectedSections": [
"sales_statistics"
],
"includeDashboardLink": true
}idstringRequirednamestringRequiredstatusAutomatedReportStatusRequired"active", "draft"frequencyAutomatedReportFrequencyRequired"monthly", "weekly", "daily"cronExpressionstringRequiredscheduleobjectsendTimestringRequiredrecipientUserIdsarray of stringexternalEmailsarray of stringselectedSectionsarray of AutomatedReportSectionRequired"sales_statistics", "sales_by_reference", "mrr", "subscriptions", "cashflow", "consents", "consent_changes"includeDashboardLinkbooleanRequiredlastSentstring (date-time)nextScheduledAtstring (date-time)createdAtstring (date-time)RequiredupdatedAtstring (date-time)RequiredrecipientCountnumberRequired{
"id": "string",
"name": "string",
"status": "active",
"frequency": "monthly",
"cronExpression": "string",
"schedule": {},
"sendTime": "string",
"recipientUserIds": [
"string"
],
"externalEmails": [
"string"
],
"selectedSections": [
"sales_statistics"
],
"includeDashboardLink": true,
"lastSent": "2019-08-24T14:15:22Z",
"nextScheduledAt": "2019-08-24T14:15:22Z",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"recipientCount": 0
}atLeastOneSectionMustBeSelected
messageCodestringRequiredmessagestringerrorsarray of FieldErrorRequired7 fieldserrorsunauthorized
This response has no body.
curlcurl https://api.subrite.no/api/v1/automated-reports \
--request POST \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "string",
"status": "active",
"frequency": "monthly",
"sendTime": "09:00",
"recipientUserIds": [
"string"
],
"externalEmails": [
"user@example.com"
],
"selectedSections": [
"sales_statistics"
],
"includeDashboardLink": true
}'AutomatedReportResponseDto{
"id": "string",
"name": "string",
"status": "active",
"frequency": "monthly",
"cronExpression": "string",
"schedule": {},
"sendTime": "string",
"recipientUserIds": [
"string"
],
"externalEmails": [
"string"
],
"selectedSections": [
"sales_statistics"
],
"includeDashboardLink": true,
"lastSent": "2019-08-24T14:15:22Z",
"nextScheduledAt": "2019-08-24T14:15:22Z",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"recipientCount": 0
}unauthorized
This response has no body.
Report not found
This response has no body.
curlcurl 'https://api.subrite.no/api/v1/automated-reports/{id}' \
--header 'Authorization: Bearer <token>'string"draft"Allowed values: "active", "draft"frequencystringOptional"monthly"Allowed values: "monthly", "weekly", "daily"sendTimestringOptional"09:00"Send time in HH:mm formatpattern: /^([01]?[0-9]|2[0-3]):[0-5][0-9]$/recipientUserIdsarray of stringOptionalexternalEmailsarray of string (email)OptionalselectedSectionsarray of stringOptional"sales_statistics", "sales_by_reference", "mrr", "subscriptions", "cashflow", "consents", "consent_changes"includeDashboardLinkbooleanOptionaltrueInclude link to dashboard{
"name": "string",
"status": "active",
"frequency": "monthly",
"sendTime": "09:00",
"recipientUserIds": [
"string"
],
"externalEmails": [
"user@example.com"
],
"selectedSections": [
"sales_statistics"
],
"includeDashboardLink": true
}Same fields as Create a new automated report (201).
{
"id": "string",
"name": "string",
"status": "active",
"frequency": "monthly",
"cronExpression": "string",
"schedule": {},
"sendTime": "string",
"recipientUserIds": [
"string"
],
"externalEmails": [
"string"
],
"selectedSections": [
"sales_statistics"
],
"includeDashboardLink": true,
"lastSent": "2019-08-24T14:15:22Z",
"nextScheduledAt": "2019-08-24T14:15:22Z",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"recipientCount": 0
}unauthorized
This response has no body.
Report not found
This response has no body.
curlcurl 'https://api.subrite.no/api/v1/automated-reports/{id}' \
--request PUT \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "string",
"status": "active",
"frequency": "monthly",
"sendTime": "09:00",
"recipientUserIds": [
"string"
],
"externalEmails": [
"user@example.com"
],
"selectedSections": [
"sales_statistics"
],
"includeDashboardLink": true
}'unauthorized
This response has no body.
Report not found
This response has no body.
curlcurl 'https://api.subrite.no/api/v1/automated-reports/{id}' \
--request DELETE \
--header 'Authorization: Bearer <token>'fieldstringRequired when parent is presentfieldValuestringRequired when parent is presentField path: errors[].fieldValueidentifierstringRequired when parent is presentField path: errors[].identifieridentifierValuestringRequired when parent is presentField path: errors[].identifierValuemessageCodestringRequired when parent is presentField path: errors[].messageCodemessagestringField path: errors[].messageerrorTypestringRequired when parent is presentField path: errors[].errorType{
"messageCode": "string",
"message": "string",
"errors": [
{}
]
}