springboardretail / springboard-docs

Springboard Retail official API docs
http://dev.springboardretail.com/
0 stars 0 forks source link

How can I use filters to call for all transactions that were made since a specific day #2

Closed supre closed 8 years ago

supre commented 8 years ago

Currently I am trying to use something like this: https://{{subdomain}}.myspringboard.us/api/inventory/transactions?page=1&per_page=100&~[created_at][$gt]=2013-04-19

Is this the way it's supposed to be done or am I making some mistake in my query?

jstotz commented 8 years ago

That looks correct to me and appeared to return the correct results in my test. Is it returning the results you expected?

supre commented 8 years ago

Aaha my bad, it was working fine. BTW, I didn't find any example on how to sort. How can I sort my returned rows based on created_at?

jstotz commented 8 years ago

Sure, I'll get the docs updated to cover sorting. In the meantime, here are some examples:

Ascending (default):

https://{{subdomain}}.myspringboard.us/api/inventory/transactions?page=1&per_page=100&~[created_at][$gt]=2013-04-19**&sort[]=created_at**

Descending:

https://{{subdomain}}.myspringboard.us/api/inventory/transactions?page=1&per_page=100&~[created_at][$gt]=2013-04-19**&sort[]=created_at,desc**

If you need to sort by multiple properties you can specify the sort[] parameter multiple times. Sorts will be applied in the order in which they're given.

supre commented 8 years ago

Aaha that works, thanks