First let me start by saying I love this software and the fact that I could restore a backup to a cloud system is just fantastic.
I have been working on a shell script for invoice creations from my google drive into Invoice Ninja (v4.4.4 | White label) and when I attempt to create the new invoice with the API as documented I am receiving an error message, see below, any help on what I am doing wrong would be greatly appreciated. Also I learned from my previous mistake and made the call from the command line as well as from the shell script and the same error returns. Also I re-used code already discussed in another post so I know the syntax is correct.
I stared out the personal data but I confirmed that the data is correct with no additional spaces or special characters in it.
<title>Redirecting to https://192.168.2.250</title>
</head>
<body>
Redirecting to <a href="https://192.168.2.250">https://192.168.2.250</a>.
</body>
---- Call Made —
curl --insecure -X POST -H Content-Type:application/json -H ‘X-Requested-With: XMLHttpRequest’ -d ‘{
“client_id”:“101”,
“invoice_items”:[{
“product_key”: “98941”,
“notes”:"*** CREATED VIA AUTOMATION ***",
“cost”:60,
“qty”:1
}
]}’ -H ‘X-Ninja-Token: *****************************qy’ https://192.168.2.250/api/v1/invoices
Ahh that I didn’t realized, I’ll look at this today/tomorrow and get back to you. Thanks for the help, it’s over and above what I expected out of the platform.
So I checked the DB to confirm and you are correct the account I was looking for was id=100 and client_id=101 but I tried the 100 and 101 id’s on both of the URL’s for the API call and this is what I get.
<title>Redirecting to https://192.168.2.250</title>
</head>
<body>
Redirecting to <a href="https://192.168.2.250">https://192.168.2.250</a>.
</body>