REST API Request with paging
Use PowerOffice Go REST APIs (v2) to retrieve paginated data.
The REST API Request with Paging action enables you to interact with the PowerOffice Go REST APIs (v2) to retrieve large, paginated datasets. This action simplifies working with endpoints that return multiple pages of data, such as customer lists, invoices, or accounting records. Pagination is managed automatically, allowing you to focus on processing the data.
Properties
Name | Type | Description |
---|---|---|
Title | Optional | The title or name of the request. |
Connection | Required | The PowerOffice Connection used to make an authenticated request to PowerOffice REST API. |
Configuration | Required | Specifies the HTTP request to the PowerOffice API, including the HTTP method, URL, parameters, and return type. |
Start page | Optional | The starting page of the data retrieval. Defaults to 1 if not specified. |
Items per page | Optional | The number of items to retrieve per page. Defaults to 5000 if not specified. |
Max page count | Optional | The maximum number of pages to fetch. Defaults to 9999 if not specified. |
Description | Optional | Additional notes or comments about the action or configuration. |
Returns
The return type is defined when configuring the action. It can be a custom data type set by e.g. the template,or the raw JSON response from the API.
We recommend using the built-in HttpResponse<T> type because it will include additional information about the response, such as the HTTP status code and error(s).
We recommend dumping the raw response into a data store and using data transformation tools to convert it into a usable format. If the API returns a relatively small dataset (10,000–200,000 records), consider using the Get JSON DataReader to flatten the JSON into a tabular format. This allows you to process the data as rows and columns, such as by inserting it directly into a SQL Server table.
Configuration
To define a request to the PowerOffice Go REST API, you can start from a template, or define it manually.
If you press the New Request
button in the Configuration dialog, you can choose from a set of predefined request templates.
The PowerOffice Go REST API is large, so the template collection contains only a subset of the available APIs. If you cannot find a template for the request you want to make, you can refer to the PowerOffice Go API documentation and define the request manually.
Optional Query Parameters
Specify query parameters to filter or customize the results. These can include:
- Filters: Narrow down results based on criteria (e.g., date ranges or specific record types).
- Sorting: Arrange results based on fields (e.g., ascending or descending order).
Use variables or fixed values within your workflow to dynamically generate the parameters as needed.
For a comprehensive guide to PowerOffice Go endpoints and parameter options, visit the PowerOffice Go API documentation.
Error handling
If the response from the Dynamics 365 Business Central REST API is set to HttpResponse<T>, the response object includes an IsSuccess
property. When IsSuccess
is false, the response has an ErrorContent
property that relay the error messages from the API call or from internally thrown exceptions.
For other response types and for severe errors, the action will raise an error that could terminate the Flow unless either the On Error
port is connected, or it is wrapped in a Try-Catch action.
The On Error
error handler will be triggered for each page error
, allowing you to handle errors individually and preventing Flow from automatically raising an error that might terminate the running process.
API Limits
PowerOffice Go enforces rate limits to ensure system stability. If you exceed these limits, the API will return a 429 Too Many Requests
error.
The Action handles this by delaying calls and using retry. If retry limit is reached an error will be returned.
Workflow Example
Configure the Action:
- Define the API endpoint, such as
customer
orinvoice
. - Add any required query parameters, including filters or sorting options.
- Define the API endpoint, such as
Handle the Response:
- Process the data page-by-page, or store it for later transformation.
- If necessary, handle errors or retry logic within your workflow.
Post-Processing:
- Use tools like SQL or Python to analyze and transform the retrieved data into a usable format.
By using the REST API Request with Paging action, you can effectively retrieve and handle large datasets from PowerOffice Go while adhering to best practices for performance and API compliance.