You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unable to get ['meta']['pagination']['total_pages'] from products = api.Products.all() #59
fails with exception: bigcommerce.exception.ClientRequestException: 413 Request Entity Too Large @ products: [{"status":413,"message":"The specified limit exceeds the maximum allowed.","details":{"max_limit":250}}]
This makes it impossible to iterate pagination within the bigcommerce-api-python library.
Hi @sabotagebeats, the pagination values you're referring to come from the V3 BC API, whereas this library is for the older V2 API and has not yet been updated for V3.
For V2, best practice is to take the count and your desired page size to determine the total number of pages over which you'll need to paginate to get all objects, and then paginate them. As per your error message, the maximum page size is 250.
To use the V3 API with this library, you can create an OAuthAPIConnection object directly and change the pathing to /v3/ like so:
This will allow you to use the low-level CRUD interface to interact with the JSON directly, as a workaround for now. An API call would then look like this:
On Jul 24, 2017 11:58 AM, "Nathan Booker" ***@***.***> wrote:
Hi @sabotagebeats <https://github.com/sabotagebeats>, the pagination
values you're referring to come from the V3 BC API, whereas this library is
for the older V2 API and has not yet been updated for V3.
For V2, best practice is to take the count and your desired page size to
determine the total number of pages over which you'll need to paginate to
get all objects, and then paginate them. As per your error message, the
maximum page size is 250.
To use the V3 API with this library, you can create an OAuthAPIConnection
object directly and change the pathing to /v3/ like so:
v3client = bigcommerce.connection.OAuthConnection(client_id=client_id,
store_hash=store_hash,
access_token=access_token,
api_path='/stores/{}/v3/{}')
This will allow you to use the low-level CRUD interface to interact with
the JSON directly, as a workaround for now. An API call would then look
like this:
products_response = v3client.get('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/catalog/products?limit=%s&page=%s'
% (page_size, current_page))
And you could access the pagination object in the response like this:
products_response['meta']['pagination']
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#59 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AasE5qRwMQvmi3qLnwbaNUWdxW2FoYY0ks5sROk5gaJpZM4OfzXB>
.
Activity
bookernath commentedon Jul 24, 2017
Hi @sabotagebeats, the pagination values you're referring to come from the V3 BC API, whereas this library is for the older V2 API and has not yet been updated for V3.
For V2, best practice is to take the count and your desired page size to determine the total number of pages over which you'll need to paginate to get all objects, and then paginate them. As per your error message, the maximum page size is 250.
To use the V3 API with this library, you can create an OAuthAPIConnection object directly and change the pathing to /v3/ like so:
This will allow you to use the low-level CRUD interface to interact with the JSON directly, as a workaround for now. An API call would then look like this:
And you could access the pagination object in the response like this:
products_response['meta']['pagination']sabotagebeats commentedon Jul 24, 2017
sabotagebeats commentedon Jul 25, 2017
Thanks this seems to work: