How to send invoice through API

How to send invoice through API

Hi,
I'm working with the Invoice API and most of it goes well !
I am however struggling with the 'send invoice' instruction.

I read that I can send out the invoice upon creation, by adding the  Send=true parameter. But I don't know where or how to integrate this.

On the other hand, I'm trying to email an already created invoice, and am sending following data through a post request:

$data = "<Custom.Subject>This is mail subject</Custom.Subject>
              <Custom.Body>This is the mail content</Custom.Body>
              <InvoiceID> 7299000000019139 </InvoiceID>
              <ToEMailIDs>7299000000018003</ToEMailIDs>
            ";
and am getting following error:  1000 zf.api.iam.InternalError

Documentation says ' Parameters to be passed
authtoken, scope, apikey, Custom.Subject, Custom.Body, InvoiceID, ToEMailIDs, CCEMailIDs'
but obviously I'm misinterpreting something.

EmailIDs also don't really exist, so . I use the ContactID instead.

Your help will be appreciated !