Pdf file upload

Pdf file upload

Hello everyone, I am trying to upload a pdf of an invoice into a file upload field and I keep getting the error that is it an invalid  api call. If anyone could help telling my what i'm doing wrong that would be great. My code is below. Thanks.

invoice_pdf = invokeurl
[
type :GET
connection:"zbooks"
];
response = invoice_pdf.getFileContent();
ticket_id = input.ID;
//openUrl(link,"new window");
pdf = invokeurl
[
url :link
type :POST
files:invoice_pdf
connection:"zbooks"
];
info pdf;