diff --git a/src/docs/version_001/docsStructure.ts b/src/docs/version_001/docsStructure.ts index e34eb00..b35498b 100644 --- a/src/docs/version_001/docsStructure.ts +++ b/src/docs/version_001/docsStructure.ts @@ -82,6 +82,12 @@ export const versionOne: DocsStructure = { copy: 'copy.md', example: 'example.md', }, + { + title: 'Get Report by Id', + folder: 'get_report_by_id', + copy: 'copy.md', + example: 'example.md', + }, ], }, { diff --git a/src/docs/version_001/resources/reports/get_report_by_id/copy.md b/src/docs/version_001/resources/reports/get_report_by_id/copy.md new file mode 100644 index 0000000..e5a047f --- /dev/null +++ b/src/docs/version_001/resources/reports/get_report_by_id/copy.md @@ -0,0 +1,41 @@ +# Get Report by Id {% #get-report-by-id %} + +This endpoint returns the [Report Data](#report-data) for the given report. + +## Path Parameters + +{% table %} + +- Property Name +- Data Type +- Description + +--- + +- reportId +- `number` +- The id of the report. + +{% /table %} + +## Query Parameters + +{% table %} + +- Property Name +- Data Type +- Description + +--- + +- dataFormat +- `string` +- The [format](#data-format) of the field data in the response. Valid values are `Raw` and `Formatted`. If not specified, `Raw` will be used. + +--- + +- dataType +- `string` +- Indicate whether you want the report's report data or its chart data returned. Valid values are `ReportData` and `ChartData`. If not specified, `ReportData` will be used. + +{% /table %} diff --git a/src/docs/version_001/resources/reports/get_report_by_id/example.md b/src/docs/version_001/resources/reports/get_report_by_id/example.md new file mode 100644 index 0000000..b1e8de6 --- /dev/null +++ b/src/docs/version_001/resources/reports/get_report_by_id/example.md @@ -0,0 +1,65 @@ +# Retrieving data from a report + +{% code method="GET" heading="/Reports/{reportId}" defaultLanguage="bash" %} + +```bash +curl --location 'https://api.onspring.com/Reports/613' \ +--header 'X-ApiKey: 000000ffffff000000ffffff/00000000-ffff-0000-ffff-000000000000' +``` + +```csharp +using Onspring.API.SDK.Helpers; +using Onspring.API.SDK.Enums; + +var httpHelper = new HttpHelper( + config.baseUrl, + config.apiKey +); + +var reportData = httpHelper.GetReportData( + reportId, + ReportDataType.ChartData, + DataFormat.Raw +); + +Console.WriteLine(string.Join(", ", reportData.Columns)); + +foreach (var row in reportData.Rows) +{ + Console.WriteLine(string.Join(", ", row.Cells)); +} +``` + +{% /code %} + +{% code heading="RESPONSE" defaultLanguage="json" %} + +```json +{ + "Columns": [ + "Name", + "Owner", + "Due Date", + "Status", + "Description" + ], + "Rows": [ + [ + "A New Test Task", + null, + null, + null, + "

This is a test task.

" + ], + [ + "A New Test Task", + "Severus", + "12/25/2021 12:00 AM", + "In Progress", + "

This is a test task.

" + ] + ] +} +``` + +{% /code %} diff --git a/src/docs/version_001/resources/reports/get_reports_by_app/example.md b/src/docs/version_001/resources/reports/get_reports_by_app/example.md index 1be3c70..fbb60cd 100644 --- a/src/docs/version_001/resources/reports/get_reports_by_app/example.md +++ b/src/docs/version_001/resources/reports/get_reports_by_app/example.md @@ -15,7 +15,7 @@ var httpHelper = new HttpHelper( config.apiKey ); -foreach (var report in httpHelper.GetAppReports(5)) +foreach (var report in httpHelper.GetAppReports(195)) { Console.WriteLine($"{report.Id}, {report.AppId}, {report.Name}"); }