API browser of generalInvoiceRequest450 COM module


/images/arrow_right.png IGeneralInvoiceRequest::AddDocument method space
Attaches a PDF, JPG or PNG document -either inline or online- to the list of documents.
 
Internally, the inline document will be transformed to a BASE64 octet representation to safeguard the binary nature of the file.
space
/images/arrow_right.png Restful webservice calling syntax
[POST] /baseURL/IGeneralInvoiceRequest/AddDocument?param
[param] pIGeneralInvoiceRequest=longValue&
eIsURL=longValue&
bstrSource=urlEncodedString&
bstrTitle=urlEncodedString&
bstrMimeType=urlEncodedString
+
<application/octet-stream> input_file_upload_stream
[JSON result data] pbStatus: booleanValue
 
[HTTP result status] 200 Return status 200 signals a successful method call
204 Return status 204 (noContent) signals that the end of an iteration is reached
>= 400 Return status >= 400 signals an unsuccessful function call. The returned JSON{errorCode: code, errorText:"text"} supplies the error message the same as GetAbortInfo() would do.
space
/images/arrow_right.png C/C++ calling syntax
HRESULT AddDocument( YesNoType
BSTR
BSTR
BSTR
VARIANT_BOOL
eIsURL,
bstrSource,
bstrTitle,
bstrMimeType,
*pbStatus);
[C/C++ return value] S_OK This value is returned if the function call was successful.
S_FALSE This value is returned if the end of an iteration is reached
E_name This value is returned if the function call was unsuccessful and an error exception was generated. Note that if you are using SmartPointers an exception is thrown under these conditions.
space
/images/arrow_right.png Calling argument description
[in] YesNoType eIsURL Boolean that defines if the document is added online using a URL (enYes) or inline as Base64 coded stream (enNo).
 
In Restful webservice system:
If eIsURL = enYes than perform a normal POST <application/json> Restful call instead of a POST urlEncoded + <application/octet-stream> Restful call!
[in] BSTR bstrSource If eIsURL = enYes then bstrSource is a URL for accessing the document online.
 
If eIsURL = enNo then bstrSource is a full file name (path + name) of the primary document. Be sure, that privileges allows opening and reading the file since the content is internally BASE64 coded.
[in] BSTR bstrTitle bstrTitle is the document's title on the primary system and thus describes the document in terms of its semantic content.
[in] BSTR bstrMimeType The MIME type of the document. The MIME type enables applications to define the format and eventually read the file (cf. RFC 2046 standardizes and names the commonly used MIME types).
 
Since the underlying XSD schema restricts the type of files, the MIME type must be one of
  • application/pdf for PDF files
  • image/jpeg for JPG graphic files
  • image/png for PNG graphic files
[out,retval] VARIANT_BOOL *pbStatus Return status of the method. If pbStatus is VARIANT_FALSE then an error occurred and GetAbortInfo should be called to retrieve the error string.
space