pythonjsoncommercetools

Commercetool Incremental Pull


I was trying to pull incremental data from commercetool api using QueryPredicates by sending last modified datetime but the api is giving full data.

https://api.{region}.commercetools.com/{projectkey}/categories?where=lastModifiedAt > 2022-04-06T00:46:32.037Z

In the documentation, it is mentioned as below Include a time range, for example lastModifiedAt > $1-week-ago and ... (replace $1-week-ago with an actual date

I tried sending last modified datetime as mentioned in documentation and was expecting it to return data greater than that but it's not working


Solution

  • The datetime string must be enclosed with double quotes. And the whole predicate must be urlencoded.

    lastModifiedAt%20%3E%20%222022-04-06T00%3A46%3A32.037Z%22