API Weirdness - some work, some don't

App Version: v4.5.7
White Label: Yes - <removed>
Server OS: Linux 2.6.32-042stab134.3
PHP Version: 7.2.13-1+ubuntu16.04.1+deb.sury.org+1
MySQL Version: 5.7.24-0ubuntu0.16.04.1

I’m a new user only discovering Invoice Ninja a couple of days ago, but I’m so impressed I’ve paid to white label.

I’m trying to get the invoice data using the API to link into my bespoke accounting system. It is failing.

To debug this, I’ve created the following script to call cURL:

curl -X GET https://<my server>/api/v1/clients -H "X-Ninja-Token: <my token>"
echo
curl -X GET https://<my server>/api/v1/products -H "X-Ninja-Token: <my token>"
echo
curl -X GET https://<my server>/api/vi/payments -H "X-Ninja-Token: <my token>"
echo
curl -X GET https://<my server>/api/vi/invoices -H "X-Ninja-Token: <my token>"
echo

Because invoices fails with a 404 error, I added calls to clients (works), products (works) and payments (fails). As this is a new installation on a test server before I deploy live, there are no payments so I’m not expecting to see data but I would not expect to see a 404 error. There are multiple test invoices that have been emailed and viewed and it is these that I need to pull down.

Given that both invoices and payments throw a 404, is there a link of some kind here?

The apache2 log entries are

<ip address removed> - - [23/Dec/2018:15:39:17 +0000] "GET /api/v1/clients HTTP/1.1" 200 15386 "-" "curl/7.61.0"
<ip address removed> - - [23/Dec/2018:15:39:17 +0000] "GET /api/v1/products HTTP/1.1" 200 6247 "-" "curl/7.61.0"
<ip address removed> - - [23/Dec/2018:15:39:18 +0000] "GET /api/vi/payments HTTP/1.1" 404 3602 "-" "curl/7.61.0"
<ip address removed> - - [23/Dec/2018:15:39:18 +0000] "GET /api/vi/invoices HTTP/1.1" 404 3602 "-" "curl/7.61.0"

There is nothing in the /storage/logs/* files.

Am I being dumb? I don’t know where to start looking to resolve this. Happy to provide login in details via PM if it will help.

Thanks

The route is wrong, you have an ‘i’ instead of a ‘1’

Like I said dumb :wink:

Thanks. I stared at that for hours. Probably should change to a mono font for code editing!