Interface ReportResources
-
public interface ReportResourcesThis interface provides methods to access Report resources.
Thread Safety: Implementation of this interface must be thread safe.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<ReportColumn>addReportColumns(long reportId, java.util.List<ReportColumn> reportColumns)Add columns to a report.voidaddReportScope(long id, java.util.List<ReportScopeInclusion> scopes)Adds one or more specified sheet or workspace to the report scope.CreateReportResultcreateReport(CreateReportRequest request)Create a new report.voiddeleteReport(long id)Deletes a report.voiddeleteReportColumn(long reportId, long columnVirtualId)Delete a single column from a report.ReportPublishgetPublishStatus(long id)Get the publish status of a report.ReportgetReport(long reportId, java.util.EnumSet<ReportInclusion> includes, java.lang.Integer pageSize, java.lang.Integer page)Get a report.ReportgetReport(long reportId, java.util.EnumSet<ReportInclusion> includes, java.lang.Integer pageSize, java.lang.Integer page, java.lang.Integer level)Get a report.voidgetReportAsCsv(long id, java.io.OutputStream outputStream)Get a Report as an csv file.voidgetReportAsExcel(long id, java.io.OutputStream outputStream)Get a Report as an excel file.ReportColumngetReportColumn(long reportId, long columnVirtualId)Get a single column from a report.ReportColumngetReportColumn(long reportId, long columnVirtualId, java.lang.Integer level)Get a single column from a report.ReportDefinitiongetReportDefinition(long reportId)Gets a report's definition (filters, grouping, summarize, and sorting).ReportPathNodegetReportPath(long reportId)Get the path of a report (workspace/folder hierarchy).TokenPaginatedResult<ReportColumn>listReportColumns(long reportId, java.lang.String lastKey, java.lang.Long maxItems)List columns for a report.TokenPaginatedResult<ReportColumn>listReportColumns(long reportId, java.lang.String lastKey, java.lang.Long maxItems, java.lang.Integer level)List columns for a report.PagedResult<Report>listReports(PaginationParameters parameters)List all reports.PagedResult<Report>listReports(PaginationParameters parameters, java.util.Date modifiedSince)List all reports.TokenPaginatedResult<ReportScopeInclusion>listReportScope(long reportId, java.lang.String lastKey, java.lang.Long maxItems)List the scope of a report (the sheets and workspaces included in the report).voidremoveReportScope(long id, java.util.List<ReportScopeInclusion> scopes)Removes one or more specified sheet or workspace from the report scope.voidsendReport(long reportId, SheetEmail email)Send a sheet as a PDF attachment via Email To the designated recipients.ReportPublishupdatePublishStatus(long id, ReportPublish reportPublish)Sets the publish status of a report and returns the new status, including the URLs of any enabled publishing.ReportColumnupdateReportColumn(long reportId, long columnVirtualId, UpdateReportColumnRequest request)Updates a report column.voidupdateReportDefinition(long id, ReportDefinition reportDefinition)Updates a report's definition (filters, grouping, summarize, and sorting).
-
-
-
Method Detail
-
getReport
Report getReport(long reportId, java.util.EnumSet<ReportInclusion> includes, java.lang.Integer pageSize, java.lang.Integer page) throws SmartsheetException
Get a report.
It mirrors to the following Smartsheet REST API method: GET /report/{reportId}
- Parameters:
reportId- the reportId of the reportincludes- used To specify the optional objects to include.pageSize- page size parameter for paginationpage- page parameter for pagination- Returns:
- the report (note that if there is no such resource, this method will throw ResourceNotFoundException rather than returning null)
- Throws:
java.lang.IllegalArgumentException- if any argument is null or empty stringInvalidRequestException- if there is any problem with the REST API requestAuthorizationException- if there is any problem with the REST API authorization (access token)ResourceNotFoundException- if the resource cannot be foundServiceUnavailableException- if the REST API service is not available (possibly due to rate limiting)SmartsheetException- if there is any other error during the operation
-
getReport
Report getReport(long reportId, java.util.EnumSet<ReportInclusion> includes, java.lang.Integer pageSize, java.lang.Integer page, java.lang.Integer level) throws SmartsheetException
Get a report.
It mirrors to the following Smartsheet REST API method: GET /report/{reportId}
- Parameters:
reportId- the reportId of the reportincludes- used To specify the optional objects to include.pageSize- page size parameter for paginationpage- page parameter for paginationlevel- compatibility level- Returns:
- the report (note that if there is no such resource, this method will throw ResourceNotFoundException rather than returning null)
- Throws:
java.lang.IllegalArgumentException- if any argument is null or empty stringInvalidRequestException- if there is any problem with the REST API requestAuthorizationException- if there is any problem with the REST API authorization (access token)ResourceNotFoundException- if the resource cannot be foundServiceUnavailableException- if the REST API service is not available (possibly due to rate limiting)SmartsheetException- if there is any other error during the operation
-
sendReport
void sendReport(long reportId, SheetEmail email) throws SmartsheetExceptionSend a sheet as a PDF attachment via Email To the designated recipients.
It mirrors to the following Smartsheet REST API method: POST /reports/{reportId}/emails
- Parameters:
reportId- the reportId of the reportemail- email of designated recipient.- Throws:
java.lang.IllegalArgumentException- if any argument is null or empty stringInvalidRequestException- if there is any problem with the REST API requestAuthorizationException- if there is any problem with the REST API authorization (access token)ResourceNotFoundException- if the resource cannot be foundServiceUnavailableException- if the REST API service is not available (possibly due to rate limiting)SmartsheetException- if there is any other error during the operation
-
listReports
PagedResult<Report> listReports(PaginationParameters parameters, java.util.Date modifiedSince) throws SmartsheetException
List all reports.
It mirrors to the following Smartsheet REST API method: GET /reports
Exceptions: - InvalidRequestException : if there is any problem with the REST API request - AuthorizationException : if there is any problem with the REST API authorization(access token) - ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting) - SmartsheetRestException : if there is any other REST API related error occurred during the operation - SmartsheetException : if there is any other error occurred during the operation
- Parameters:
parameters- pagination parameters for paging resultmodifiedSince- restrict results to sheets modified on or after this date- Returns:
- all sheets (note that empty list will be returned if there is none)
- Throws:
SmartsheetException- the smartsheet exception
-
listReports
PagedResult<Report> listReports(PaginationParameters parameters) throws SmartsheetException
List all reports.
It mirrors to the following Smartsheet REST API method: GET /reports
Exceptions: - InvalidRequestException : if there is any problem with the REST API request - AuthorizationException : if there is any problem with the REST API authorization(access token) - ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting) - SmartsheetRestException : if there is any other REST API related error occurred during the operation - SmartsheetException : if there is any other error occurred during the operation
- Parameters:
parameters- pagination parameters for paging result- Returns:
- all sheets (note that empty list will be returned if there is none)
- Throws:
SmartsheetException- the smartsheet exception
-
getReportAsExcel
void getReportAsExcel(long id, java.io.OutputStream outputStream) throws SmartsheetExceptionGet a Report as an excel file.
It mirrors to the following Smartsheet REST API method: GET /reports/{id} with "application/vnd.ms-excel" Accept HTTP header
Exceptions: IllegalArgumentException : if outputStream is null InvalidRequestException : if there is any problem with the REST API request AuthorizationException : if there is any problem with the REST API authorization(access token) ResourceNotFoundException : if the resource can not be found ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting) SmartsheetRestException : if there is any other REST API related error occurred during the operation SmartsheetException : if there is any other error occurred during the operation
- Parameters:
id- the idoutputStream- the OutputStream to which the Excel file will be written- Throws:
SmartsheetException- the smartsheet exception
-
getReportAsCsv
void getReportAsCsv(long id, java.io.OutputStream outputStream) throws SmartsheetExceptionGet a Report as an csv file.
It mirrors to the following Smartsheet REST API method: GET /reports/{id} with "application/vnd.ms-excel" Accept HTTP header
Exceptions: IllegalArgumentException : if outputStream is null InvalidRequestException : if there is any problem with the REST API request AuthorizationException : if there is any problem with the REST API authorization(access token) ResourceNotFoundException : if the resource can not be found ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting) SmartsheetRestException : if there is any other REST API related error occurred during the operation SmartsheetException : if there is any other error occurred during the operation
- Parameters:
id- the idoutputStream- the OutputStream to which the Excel file will be written- Throws:
SmartsheetException- the smartsheet exception
-
getPublishStatus
ReportPublish getPublishStatus(long id) throws SmartsheetException
Get the publish status of a report.
It mirrors to the following Smartsheet REST API method: GET /reports/{id}/publish
- Parameters:
id- the ID of the report- Returns:
- the report publish status (note that if there is no such resource, this method will throw ResourceNotFoundException rather than returning null).
- Throws:
java.lang.IllegalArgumentException- if any argument is null or empty stringInvalidRequestException- if there is any problem with the REST API requestAuthorizationException- if there is any problem with the REST API authorization (access token)ResourceNotFoundException- if the resource cannot be foundServiceUnavailableException- if the REST API service is not available (possibly due to rate limiting)SmartsheetException- if there is any other error during the operation
-
updatePublishStatus
ReportPublish updatePublishStatus(long id, ReportPublish reportPublish) throws SmartsheetException
Sets the publish status of a report and returns the new status, including the URLs of any enabled publishing.
It mirrors to the following Smartsheet REST API method: PUT /reports/{id}/publish
- Parameters:
id- the ID of the reportreportPublish- the ReportPublish object- Returns:
- the updated ReportPublish (note that if there is no such resource, this method will throw ResourceNotFoundException rather than returning null)
- Throws:
java.lang.IllegalArgumentException- if any argument is null or empty stringInvalidRequestException- if there is any problem with the REST API requestAuthorizationException- if there is any problem with the REST API authorization (access token)ResourceNotFoundException- if the resource cannot be foundServiceUnavailableException- if the REST API service is not available (possibly due to rate limiting)SmartsheetException- if there is any other error during the operation
-
getReportDefinition
ReportDefinition getReportDefinition(long reportId) throws SmartsheetException
Gets a report's definition (filters, grouping, summarize, and sorting).
It mirrors to the following Smartsheet REST API method: GET /reports/{id}/definition
- Parameters:
reportId- the ID of the report- Returns:
- the ReportDefinition object
- Throws:
java.lang.IllegalArgumentException- if any argument is nullInvalidRequestException- if there is any problem with the REST API requestAuthorizationException- if there is any problem with the REST API authorization (access token)ResourceNotFoundException- if the resource cannot be foundServiceUnavailableException- if the REST API service is not available (possibly due to rate limiting)SmartsheetException- if there is any other error during the operation
-
updateReportDefinition
void updateReportDefinition(long id, ReportDefinition reportDefinition) throws SmartsheetExceptionUpdates a report's definition (filters, grouping, summarize, and sorting).
It mirrors to the following Smartsheet REST API method: PUT /reports/{id}/definition
This endpoint supports partial updates only on root level properties of the report definition, such as
filters,groupingCriteria, andsummarizingCriteria. For example, you can update the report's filters without affecting its grouping criteria. However, nested properties within these objects, such as a specific filter or grouping criterion, cannot be updated individually and require a full replacement of the respective section.- Parameters:
id- the ID of the reportreportDefinition- the ReportDefinition object containing the updated definition- Throws:
java.lang.IllegalArgumentException- if any argument is nullInvalidRequestException- if there is any problem with the REST API requestAuthorizationException- if there is any problem with the REST API authorization (access token)ResourceNotFoundException- if the resource cannot be foundServiceUnavailableException- if the REST API service is not available (possibly due to rate limiting)SmartsheetException- if there is any other error during the operation
-
deleteReport
void deleteReport(long id) throws SmartsheetExceptionDeletes a report.
Mirrors the following Smartsheet REST API method: DELETE /reports/{reportId}
- Parameters:
id- the id of the report- Throws:
java.lang.IllegalArgumentException- if any argument is null or empty stringInvalidRequestException- if there is any problem with the REST API requestAuthorizationException- if there is any problem with the REST API authorization (access token)ResourceNotFoundException- if the resource cannot be foundServiceUnavailableException- if the REST API service is not available (possibly due to rate limiting)SmartsheetException- if there is any other error during the operation
-
addReportScope
void addReportScope(long id, java.util.List<ReportScopeInclusion> scopes) throws SmartsheetExceptionAdds one or more specified sheet or workspace to the report scope.
- Parameters:
id- the ID of the reportscopes- A list of one or more objects denoting the sheets or workspaces associated with the report to be added to the report scope.- Throws:
java.lang.IllegalArgumentException- if any argument is null or empty stringInvalidRequestException- if there is any problem with the REST API requestAuthorizationException- if there is any problem with the REST API authorization (access token)ResourceNotFoundException- if the resource cannot be foundServiceUnavailableException- if the REST API service is not available (possibly due to rate limiting)SmartsheetException- if there is any other error during the operation
-
removeReportScope
void removeReportScope(long id, java.util.List<ReportScopeInclusion> scopes) throws SmartsheetExceptionRemoves one or more specified sheet or workspace from the report scope.
- Parameters:
id- the ID of the reportscopes- A list of one or more objects denoting the sheets or workspaces associated with the report to be removed from the report scope.- Throws:
java.lang.IllegalArgumentException- if any argument is null or empty stringInvalidRequestException- if there is any problem with the REST API requestAuthorizationException- if there is any problem with the REST API authorization (access token)ResourceNotFoundException- if the resource cannot be foundServiceUnavailableException- if the REST API service is not available (possibly due to rate limiting)SmartsheetException- if there is any other error during the operation
-
listReportScope
TokenPaginatedResult<ReportScopeInclusion> listReportScope(long reportId, java.lang.String lastKey, java.lang.Long maxItems) throws SmartsheetException
List the scope of a report (the sheets and workspaces included in the report).
It mirrors to the following Smartsheet REST API method: GET /reports/{reportId}/scope
- Parameters:
reportId- the ID of the reportlastKey- token for retrieving the next page of results (optional)maxItems- maximum number of items to return (optional)- Returns:
- a TokenPaginatedResult containing the list of ReportScopeInclusion objects
- Throws:
java.lang.IllegalArgumentException- if any argument is null or empty stringInvalidRequestException- if there is any problem with the REST API requestAuthorizationException- if there is any problem with the REST API authorization (access token)ResourceNotFoundException- if the resource cannot be foundServiceUnavailableException- if the REST API service is not available (possibly due to rate limiting)SmartsheetException- if there is any other error during the operation
-
addReportColumns
java.util.List<ReportColumn> addReportColumns(long reportId, java.util.List<ReportColumn> reportColumns) throws SmartsheetException
Add columns to a report.
It mirrors to the following Smartsheet REST API method: POST /reports/{reportId}/columns
Note: All indexes of the columns must be equal.
- Parameters:
reportId- the ID of the reportreportColumns- the list of columns to add (must contain 1-400 items)- Returns:
- the list of columns that were added
- Throws:
java.lang.IllegalArgumentException- if any argument is null or empty stringInvalidRequestException- if there is any problem with the REST API requestAuthorizationException- if there is any problem with the REST API authorization (access token)ResourceNotFoundException- if the resource cannot be foundServiceUnavailableException- if the REST API service is not available (possibly due to rate limiting)SmartsheetException- if there is any other error during the operation
-
listReportColumns
TokenPaginatedResult<ReportColumn> listReportColumns(long reportId, java.lang.String lastKey, java.lang.Long maxItems) throws SmartsheetException
List columns for a report.
It mirrors to the following Smartsheet REST API method: GET /reports/{reportId}/columns
- Parameters:
reportId- the ID of the reportlastKey- token for retrieving the next page of results (optional)maxItems- maximum number of items to return (optional)- Returns:
- a TokenPaginatedResult containing the list of ReportColumn objects and a lastKey for pagination
- Throws:
java.lang.IllegalArgumentException- if any argument is null or empty stringInvalidRequestException- if there is any problem with the REST API requestAuthorizationException- if there is any problem with the REST API authorization (access token)ResourceNotFoundException- if the resource cannot be foundServiceUnavailableException- if the REST API service is not available (possibly due to rate limiting)SmartsheetException- if there is any other error during the operation
-
listReportColumns
TokenPaginatedResult<ReportColumn> listReportColumns(long reportId, java.lang.String lastKey, java.lang.Long maxItems, java.lang.Integer level) throws SmartsheetException
List columns for a report.
It mirrors to the following Smartsheet REST API method: GET /reports/{reportId}/columns
- Parameters:
reportId- the ID of the reportlastKey- token for retrieving the next page of results (optional)maxItems- maximum number of items to return (optional)level- compatibility level- Returns:
- a TokenPaginatedResult containing the list of ReportColumn objects and a lastKey for pagination
- Throws:
java.lang.IllegalArgumentException- if any argument is null or empty stringInvalidRequestException- if there is any problem with the REST API requestAuthorizationException- if there is any problem with the REST API authorization (access token)ResourceNotFoundException- if the resource cannot be foundServiceUnavailableException- if the REST API service is not available (possibly due to rate limiting)SmartsheetException- if there is any other error during the operation
-
updateReportColumn
ReportColumn updateReportColumn(long reportId, long columnVirtualId, UpdateReportColumnRequest request) throws SmartsheetException
Updates a report column.
It mirrors to the following Smartsheet REST API method: PUT /reports/{reportId}/columns/{columnVirtualId}
- Parameters:
reportId- the ID of the reportcolumnVirtualId- the virtual ID of the column to updaterequest- the UpdateReportColumnRequest containing the fields to update- Returns:
- the updated ReportColumn
- Throws:
java.lang.IllegalArgumentException- if any argument is nullInvalidRequestException- if there is any problem with the REST API requestAuthorizationException- if there is any problem with the REST API authorization (access token)ResourceNotFoundException- if the resource cannot be foundServiceUnavailableException- if the REST API service is not available (possibly due to rate limiting)SmartsheetException- if there is any other error during the operation
-
createReport
CreateReportResult createReport(CreateReportRequest request) throws SmartsheetException
Create a new report.
It mirrors to the following Smartsheet REST API method: POST /reports
Creates a new report by specifying name, destination, scope, columns and definition.
- Parameters:
request- the CreateReportRequest containing report specifications- Returns:
- the CreateReportResult containing the newly created report information
- Throws:
java.lang.IllegalArgumentException- if any argument is nullInvalidRequestException- if there is any problem with the REST API requestAuthorizationException- if there is any problem with the REST API authorization (access token)ServiceUnavailableException- if the REST API service is not available (possibly due to rate limiting)SmartsheetException- if there is any other error during the operation
-
getReportPath
ReportPathNode getReportPath(long reportId) throws SmartsheetException
Get the path of a report (workspace/folder hierarchy).
It mirrors to the following Smartsheet REST API method: GET /reports/{reportId}/path
- Parameters:
reportId- the report id- Returns:
- the container path representing the hierarchy from the workspace down to the report
- Throws:
java.lang.IllegalArgumentException- if any argument is null or empty stringInvalidRequestException- if there is any problem with the REST API requestAuthorizationException- if there is any problem with the REST API authorization (access token)ResourceNotFoundException- if the resource cannot be foundServiceUnavailableException- if the REST API service is not available (possibly due to rate limiting)SmartsheetException- if there is any other error during the operation
-
getReportColumn
ReportColumn getReportColumn(long reportId, long columnVirtualId) throws SmartsheetException
Get a single column from a report.
It mirrors to the following Smartsheet REST API method: GET /reports/{reportId}/columns/{columnVirtualId}
- Parameters:
reportId- the ID of the reportcolumnVirtualId- the virtual ID of the column- Returns:
- the ReportColumn (note that if there is no such resource, this method will throw ResourceNotFoundException rather than returning null)
- Throws:
java.lang.IllegalArgumentException- if any argument is null or empty stringInvalidRequestException- if there is any problem with the REST API requestAuthorizationException- if there is any problem with the REST API authorization (access token)ResourceNotFoundException- if the resource cannot be foundServiceUnavailableException- if the REST API service is not available (possibly due to rate limiting)SmartsheetException- if there is any other error during the operation
-
getReportColumn
ReportColumn getReportColumn(long reportId, long columnVirtualId, java.lang.Integer level) throws SmartsheetException
Get a single column from a report.
It mirrors to the following Smartsheet REST API method: GET /reports/{reportId}/columns/{columnVirtualId}
- Parameters:
reportId- the ID of the reportcolumnVirtualId- the virtual ID of the columnlevel- compatibility level- Returns:
- the ReportColumn (note that if there is no such resource, this method will throw ResourceNotFoundException rather than returning null)
- Throws:
java.lang.IllegalArgumentException- if any argument is null or empty stringInvalidRequestException- if there is any problem with the REST API requestAuthorizationException- if there is any problem with the REST API authorization (access token)ResourceNotFoundException- if the resource cannot be foundServiceUnavailableException- if the REST API service is not available (possibly due to rate limiting)SmartsheetException- if there is any other error during the operation
-
deleteReportColumn
void deleteReportColumn(long reportId, long columnVirtualId) throws SmartsheetExceptionDelete a single column from a report.
It mirrors to the following Smartsheet REST API method: DELETE /reports/{reportId}/columns/{columnVirtualId}
- Parameters:
reportId- the ID of the reportcolumnVirtualId- the virtual ID of the column- Throws:
java.lang.IllegalArgumentException- if any argument is null or empty stringInvalidRequestException- if there is any problem with the REST API requestAuthorizationException- if there is any problem with the REST API authorization (access token)ResourceNotFoundException- if the resource cannot be foundServiceUnavailableException- if the REST API service is not available (possibly due to rate limiting)SmartsheetException- if there is any other error during the operation
-
-