Get PDF download url by API

29
April 17, 2021, at 6:10 PM

I am currently making a Wordpress plugin as a link between an accounting system. This API manual prescribes that an invoice can be downloaded with:

# You can also use wget
curl -X GET https://api.URL.com/invoices/{id}/download \
   -H 'Accept: application / pdf'

All other api requests work fine, but here I get the error:

{"error": {"code": 422, "key": "params.invalid", "message": "The parameters are invalid (either missing, not of the correct type or incorrect format).", "details" : [{"key": "is_invalid", "param": "id", "message": "is invalid"}]}}

I try to make the request with the function below:

function download_jortt_invoice() {
    $post_meta_invoice_id = get_post_meta( $order->id, '_invoice_id', true );
    $api = new API_Client(APPID, APPTOKEN, CallBackUrl);
    
    $auth_token = get_option( 'invoice_read_token');
    $get_download_link = $api->getrequest('invoices/'. $post_meta_invoice_id .'/download', $auth_token);
    $get_download_url = json_decode($get_download_link);
    var_dump($get_download_link);
}

When I delete '/download/', I receive the entire invoice list, which is consistent with the manual. However, if I put '/ download' back in the request, this message appears. The manual on how to download a PDF can be found here: https://developer.jortt.nl/#download-invoice-pdf

What am I overlooking or why am I getting this error?

READ ALSO
How to cycle through each div's display property to “display:none” to “display:block” in an endless loop with setTimeout?

How to cycle through each div's display property to “display:none” to “display:block” in an endless loop with setTimeout?

I have a div that shows gif image and I have 4 gif image to cycle through with different duration in an endless loop(gif should cycle through 1 2 3 4 then 1 2 3 4 endlessly)

55
Matplotlib line graph in KivyMD + Python : TypeError: actualizar_timeline_ventas() takes 1 positional argument but 2 were given

Matplotlib line graph in KivyMD + Python : TypeError: actualizar_timeline_ventas() takes 1 positional argument but 2 were given

I am trying to build an app with KivyMD and Python, which will show the user a different time-line graph depending on the period he/she selects(year, month, week, day)

35
Controller Advice bean not instantiated at proper order in Spring Boot 2.4

Controller Advice bean not instantiated at proper order in Spring Boot 2.4

I'm implementing an global exception handling using ControllerAdvice and have trouble having it working with Spring Boot 24

57
What should I enter to the connection string to connect my NodeJS application to a MongoDB server?

What should I enter to the connection string to connect my NodeJS application to a MongoDB server?

I am trying to connect to a MongoDB to a nodejsI have the MongoDB running and I have an ENV file with a connection string variable

33