API call with multiple parameters issue

I cannot get the multiple params API call to work with invoices. I’m trying /api/v1/invoices?page=1&per_page=100&updated_at=“long number” which returns “Invalid token”

At the moment my quick and dirty Perl routine deliberately ignores pages but I need to process more than 15 invoices in a batch. Hence my trying to be cute and increase the number of invoices per page :wink: If this can’t be done then how do I pull multiple invoice pages? If I only use the updated_at parameter I get a batch of 15 invoices with a page count 1 of x. I can’t figure out how to pull the additional pages.

I tried /api/v1/invoices?page=2&updated_at=“long number” which again returns “Invalid token”

Again probably being dumb (making a habit of this <g>)

Are you passing your token as a header?

https://invoice-ninja.readthedocs.io/en/latest/api.html

I believe so. The actual commands I’m trying are

curl -X GET <my url>/api/v1/invoices?per_page=100&updated_at="<invoice long no>" -H "X-Ninja-Token: <my token>"

and

curl -X GET <my url>/api/v1/invoices?page=2&updated_at="<invoice long no>" -H "X-Ninja-Token: <my token>"

If I run these commands individually (i.e /api/v1/invoices?per_page=100 or /api/v1/invoices?updated_at="<invoice long no>") they both work. They fail when I put them together as above. The one I want to get working is the first one above.

Try surrounding the URL with quotes

Doh, of course! Thank you so much Hillel.

Can you mark this as [SOLVED} as I can’t edit the first message anymore?

Thanks again - you are a huge help to us all.

Glad to hear it!

We don’t mark issue on the forum as solved, we use GitHub to track open issues.