I’ve tried a lot of stuff that resulted in various errors…
A few questions :
What’s the difference between the Token and the API secret? In the code you gave me, the method _before() needs an API secret to get the TOKEN. Now, maybe I’m blind but I do have a token available in Advanced Settings / API Token but I don’t have both.
Here’s a little code sample. I’m just trying to get a list of invoices for customers #3 which does exists.
:
It returns «Whoops, looks like something went wrong.» with some layout and CSS…
If I would request :
sendRequest(‘invoices’, $data);
It actually redirects me to the billing system.
Is it because the API system is not available on Self Host? Or because I didn’t yet pay for the White Label? Because I definitely plan to do so once I finish this integration.
To filter by client add the clientId to the URL.
curl -X GET ninja.dev/api/v1/invoices/1 -H "X-Ninja-Token: TOKEN" -H "X-Requested-With: XMLHttpRequest"
But I got the results I want by trying :
$data = new stdClass;
$data->id=3;
sendRequest('invoices', $data, "GET");
I see that there’s an API for emailing_invoice but is there one that return a link to the pdf?
Sorry for the trouble, I’ve corrected the docs. We used to support /$clientId but have switched to ?client_id=$clientId to be more RESTful.
It’s possible the code will be changed in the future which may break this, it’s hard to predict as it isn’t officially supported.
The affiliates table is used by our main site to track sales (ie, white label licenses). If you’re interested in helping develop the app we’re always accepting pull requests, and if you’d like to earn money telling people about the app check out our referral program.
As for the point 2), I’ll certainly recommends your software. I think it’s doing everything well and the fact that you’re actively developping it is a major selling point.
I’ll assuredly participate in the codebase like i’m doing in all open source project i’m using.
As for the API, I have another question (for now at least)…
I am trying to fetch a single customer information WITH the contact info as well since the email is only kept there.
I’ve tried the API “clients” with GET but it always return me a list of customers with no contact:
$data = new stdClass;
$data->public_id=26; // Also tried with id and client_id
sendRequest('clients', $data, "GET");
Also tried the same thing with POST to see if it would return unmodified data but it “Whoops” me. In laravel.log, I have :
Has this been implemented yet ?
I try to interface a help desk / ticket system with Invoice Ninja and need to be able to create an new user/contact (that works!) But also verify if there already is an account by that emailadres or user id.
I could perhaps help to add this functionality if this has not been implemented due to time constrains.