Using postURL to access Zoho Invoice API

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.

  1. string invoicefunction.add_receipt()
  2. {
  3.     true_var = true;
  4.     customer_id = 485465000000073061;
  5.     account_id = 485465000000082151;
  6.     expense_id = "485465000000082513";
  7.     receipt = "1489293114607_Pages_from_Delta_Receipt.pdf";
  8.     receipt_url = "https://creatorexport.zoho.com" + zoho.appuri + "Invoice_Report/Expense_Backup_Report/download/" + receipt;
  9.     url_string = "https://invoice.zoho.com/api/v3/expenses/" + expense_id + "?receipt=" + receipt_url + "&authtoken=xxxxxxxxxxxxxx&organization_id=xxxxxxx";
  10.     url_map = map();
  11.     expense_map.put("expense_receipt_name", receipt);
  12.     expense_map.put("expense_receipt_type", "pdf");
  13.     expense_update = postUrl(url_string,expense_map);
  14.     return expense_update;
  15. }