Put attachment

Method put_attachment is used for uploading attachments to an invoice.

Return value(s)

This method returns return code as a string.

Authentication

This method requires that you have registered to Maventa and received the API key.

Arguments

  1. API key string (required)
  2. Company ID string (required)
  3. Filename string (required)
  4. File as SOAP attachment (required)

Example code

 1   require 'soap/rpc/driver'
 2   require 'soap/attachment'
 3 
 4   driver = SOAP::RPC::Driver.new('https://trx.maventa.com/', 'files')
 5   driver.add_method('put_attachment', 'api_key', 'company_uuid', 'name', 'file')
 6 
 7   api_key = "" # put here your personal API key.
 8   company_uuid = # company uuid
 9   attachment = SOAP::Attachment.new(File.open(name))
10   invoice_id = "Invoice ID" 
11 
12   puts driver.put_attachment(api_key, company_uuid, name, attachment)

Also available in: HTML TXT