Solved

Products by created_at_min in Rest Admin API not working

rkap
Visitor
2 0 0
$params = array(
'created_at_min' => '2019-08-01T00:00:00',
);
to

/admin/api/2019-10/products.json

 This response does not respect the created_at_min value and instead it returns all the products.

 

Accepted Solution (1)

hassain
Shopify Staff (Retired)
624 104 187

This is an accepted solution.

Hey @rkap ,

 

I can confirm on my end that the Query String Parameter of 'created_at_min' is still functioning as intended through the Admin Product API.

 

Could you please provide more information about the API Requests you are making, so we could better troubleshoot the issues you are facing? Could you provide the name of the Shop you are making the API request for and the time at which you made the request? Also, if possible, if you could provide the value of the 'X-Request-ID' header from your API response that would be even better.

 

To learn more visit the Shopify Help Center or the Community Blog.

View solution in original post

Replies 3 (3)

hassain
Shopify Staff (Retired)
624 104 187

This is an accepted solution.

Hey @rkap ,

 

I can confirm on my end that the Query String Parameter of 'created_at_min' is still functioning as intended through the Admin Product API.

 

Could you please provide more information about the API Requests you are making, so we could better troubleshoot the issues you are facing? Could you provide the name of the Shop you are making the API request for and the time at which you made the request? Also, if possible, if you could provide the value of the 'X-Request-ID' header from your API response that would be even better.

 

To learn more visit the Shopify Help Center or the Community Blog.

rkap
Visitor
2 0 0

Shop is naughty-north.myshopify.com

 

[X-Request-ID] => Array
(
[0] => 8a02e064-0dab-4946-8f5c-ff8698ad2658
)

 

first product returned is

 

[created_at] => 2019-07-29T00:29:39-04:00

hassain
Shopify Staff (Retired)
624 104 187

Hey @rkap ,

 

Thank you for the additional information!

 

I believe you may have provided the wrong X-Request-Id here, because from looking through the API logs the response with "X-Request-Id=8a02e064-0dab-4946-8f5c-ff8698ad2658" was actually an authentication request for the "/admin/auth/login" endpoint (and not a request for the Admin Product API).

 

When just looking through all the API logs for requests that hit the "admin/api/2019-10/products.json" endpoint for your specific store, I could not see any requests that featured the query string parameter of "created_at_min=2019-08-01T00:00:00". So it could be possible that this query string parameter is not being correctly appended to your Admin Product API request. 

 

If you still see this issue persisting, please verify that the "created_at_min" query string parameter is being correctly appended to the Admin Product API request with the correct value. If you can confirm that it is, then please provide me with the correct value of the 'X-Request-ID' from your API response or the precise time at which you made the request. 

To learn more visit the Shopify Help Center or the Community Blog.