Home Forums Support API Weirdness – some work, some don't

This topic contains 2 replies, has 2 voices, and was last updated by  brackenhill_mob 2 months, 4 weeks ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #17814

    brackenhill_mob
    Participant

    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

    #17816

    Hillel Coren
    Keymaster

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

    #17818

    brackenhill_mob
    Participant

    Like I said dumb 😉

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

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

Posted in: