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": "2018-12-11T17:02:28.8422565+02:00",
  "PeriodEnd": "2018-12-11T17:02:28.8422565+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>2018-12-11T17:02:28.8422565+02:00</PeriodEnd>
  <PeriodStart>2018-12-11T17:02:28.8422565+02:00</PeriodStart>
  <ReportType>IncomeReport</ReportType>
</ReportCreateRequest>

application/x-www-form-urlencoded

Sample:
ReportType=IncomeReport&PeriodStart=12%2F11%2F2018%205%3A02%3A28%20PM&PeriodEnd=12%2F11%2F2018%205%3A02%3A28%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": "b51d1ee2-04c8-4268-bc1d-0f66c71b5d16"
  },
  "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>b51d1ee2-04c8-4268-bc1d-0f66c71b5d16</ReportId>
  </Payload>
</ApiResultCreateReport>