Using postURL to access Zoho Invoice API
I need to add a receipt file to an expense in Zoho Invoice, which does not appear to be available as an option in the standard deluge script. I've written a function to use the API for Zoho interface, but cannot get the postURL function to work. I am able to get the getURL to work properly, so there seems to be a formatting issue with the postURL function.
- string invoicefunction.add_receipt()
- {
- true_var = true;
- customer_id = 485465000000073061;
- account_id = 485465000000082151;
- expense_id = "485465000000082513";
- receipt = "1489293114607_Pages_from_Delta_Receipt.pdf";
- receipt_url = "https://creatorexport.zoho.com" + zoho.appuri + "Invoice_Report/Expense_Backup_Report/download/" + receipt;
- url_string = "https://invoice.zoho.com/api/v3/expenses/" + expense_id + "?receipt=" + receipt_url + "&authtoken=xxxxxxxxxxxxxx&organization_id=xxxxxxx";
- url_map = map();
- expense_map.put("expense_receipt_name", receipt);
- expense_map.put("expense_receipt_type", "pdf");
- expense_update = postUrl(url_string,expense_map);
- return expense_update;
- }