I am developing the SquareUp Api plugin. I have stuck to an issue.
I am not able to fetch data page wise. Your api documentation is showing only the Page Size as request parameter and returns a cursor for the next set of data.
But I want to pass [Page Number/OffSet] to the requested api call. How can I do this?
Unfortunately, fetching data using a page number or offset isn’t currently available.
The Square API uses cursor-based pagination, which means that instead of specifying a page number or offset, you use a cursor to fetch the next set of results. Here’s a brief overview of how this works:
Initial Request: You make an initial request specifying the limit (page size).
Response with Cursor: The response includes a cursor if there are additional results to fetch.
Subsequent Requests: Use the cursor in subsequent requests to fetch the next set of results.
Initial Request: Specify the page size (limit) in your request.
Response with Cursor: The response includes a cursor if there are additional results.
Subsequent Requests: Use the cursor in subsequent requests to fetch the next set of results.
Here’s a brief example:
Initial Request
curl https://connect.squareup.com/v2/customers/search
-X POST
-H ‘Square-Version: 2021-12-15’
-H ‘Authorization: Bearer YOUR_ACCESS_TOKEN’
-H ‘Content-Type: application/json’
-d ‘{
“limit”: 2
}’