POST api/v1/report

Request to generate specified report type for set period.

Requires authorization!

Requires scope ReportCreate

Response Codes

  • 202 – Successfully accepted request. It may take some time until the reports are created.
  • 400 – Report type is not supported
  • 400 – PeriodStart or PeriodEnd is empty
  • 400 – PeriodStart is too small (less than 2009-01-01)
  • 400 – PeriodEnd is too large (more than 20 years from today)
  • 401 – User is not Authorized

Request Information

URI Parameters

None.

Body Parameters

ReportCreateRequest
NameDescriptionTypeAdditional information
ReportType

ReportType

Required

PeriodStart

date

None.

PeriodEnd

date

None.

Request Formats

application/json, text/json

Sample:
{
  "ReportType": 1,
  "PeriodStart": "2024-03-27T23:39:50.0117978+02:00",
  "PeriodEnd": "2024-03-27T23:39:50.0117978+02:00"
}

application/xml, text/xml

Sample:
<ReportCreateRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Sobralaen.Api.Models">
  <PeriodEnd>2024-03-27T23:39:50.0117978+02:00</PeriodEnd>
  <PeriodStart>2024-03-27T23:39:50.0117978+02:00</PeriodStart>
  <ReportType>IncomeReport</ReportType>
</ReportCreateRequest>

application/x-www-form-urlencoded

Sample:
ReportType=IncomeReport&PeriodStart=3%2F27%2F2024%2011%3A39%3A50%20PM&PeriodEnd=3%2F27%2F2024%2011%3A39%3A50%20PM

Response Information

Resource Description

Request to generate specified report type for set period.

ApiResultCreateReport
NameDescriptionTypeAdditional information
Payload

The payload of the response. Type depends on the API request.

ReportResponse

None.

Success

Indicates if the request was successfull or not. true if the request was handled successfully, false otherwise.

boolean

Required

Errors

Error(s) accociated with the API request.

Collection of ApiError

None.

Response Formats

application/json, text/json

Sample:
{
  "Payload": {
    "ReportId": "f6e089cd-7c2b-463f-b45f-4fd2adef5ce7"
  },
  "Success": true,
  "Errors": [
    {
      "Code": 1,
      "Message": "sample string-2",
      "Details": "sample string-3"
    },
    {
      "Code": 1,
      "Message": "sample string-2",
      "Details": "sample string-3"
    }
  ]
}

application/xml, text/xml

Sample:
<ApiResultCreateReport xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Sobralaen.Api.Models">
  <Errors>
    <ApiError>
      <Code>1</Code>
      <Details>sample string-3</Details>
      <Message>sample string-2</Message>
    </ApiError>
    <ApiError>
      <Code>1</Code>
      <Details>sample string-3</Details>
      <Message>sample string-2</Message>
    </ApiError>
  </Errors>
  <Success>true</Success>
  <Payload>
    <ReportId>f6e089cd-7c2b-463f-b45f-4fd2adef5ce7</ReportId>
  </Payload>
</ApiResultCreateReport>