See also the DocumentUpload response object.

availability

The ability to upload documents via the API is currently in a limited release, and the API is subject to change.

Parameters
file required, file

The binary data of the file to upload. Only png, jpg, jpeg, or pdf files are supported.

kind required, multiple

The type of uploaded document. Value should always be EvidenceDocument.

Examples

Node.js
let fs = require('fs');

gateway.documentUpload.create({
  kind: DocumentUpload.Kind.EvidenceDocument,
  file: fs.createReadStream('local_file.pdf')
}).then((result) => {
  if (response.success) {
    // document successfully uploaded
    let document = response.documentUpload;
  } else {
    console.log(response.errors);
  }
});