The DocumentAPI is used to manage documents within Veeva

Hierarchy

  • DocumentAPI

Implements

Constructors

Properties

API for managing document lifecycles

API for managing document relationships

restAPI: RestAPI
types: TypesAPI

API for getting types related to documents

version: VersionAPI

API for managing document versions

Methods

  • Create a document in the Veeva environment.

    The file/contents to upload to Veeva can be defined by the filename__v property - include a full path string to the .zip file to upload, and the API Service will also define the file name for you.

    const service = new VeevaService(credentials)
    await service.document.create({
    filename__v: './path/to/content.zip'
    lifecycle__v: 'CRM Content Lifecycle',
    type__v: 'Slide',
    product__v: '00P000000000C01',
    country__v: 'unitedKingdom',
    name__v: 'Test Document'
    })

    Returns

    Response from Veeva

    Parameters

    Returns Promise<IVeevaResponse>

  • Delete a document in the Veeva environment.

    const service = new VeevaService(credentials)
    await service.document.delete(2000)

    Returns

    Response from Veeva

    Parameters

    • id: number

      Document to delete in Veeva

    Returns Promise<IVeevaResponse>

  • Get a complete list of all documents within the Veeva environment

    const service = new VeevaService(credentials)
    await service.document.get()

    Returns

    An array of documents in Veeva

    Returns Promise<IDocument[]>

  • Get a single document from the Veeva environment

    const service = new VeevaService(credentials)
    await service.document.getById(2000)

    Returns

    A single document from Veeva

    Parameters

    • id: number

      Document id to get from Veeva

    Returns Promise<IDocument>

  • Update the metadata for a document in veeva

    This does not update the actual file contents of the document. To do that - look at document.version.create()

    const service = new VeevaService(credentials)
    await service.document.update(2000, {
    name__v: 'Updated Name'
    })

    Returns

    Response from Veeva

    Parameters

    • id: number

      The ID of the document to update

    • data: IDocument

      The document data to update

    Returns Promise<IVeevaResponse>

Generated using TypeDoc