Content Management and Capture

Content Management and Capture

Come for answers. Stay for best practices. All we’re missing is you.

 View Only

How do i upload a document with content using GraphQL.

  • 1.  How do i upload a document with content using GraphQL.

    Posted Mon October 16, 2023 11:31 AM

    Hi,

    We have a requirement uploading the documents with content into P8 by triggering the Create Document mutation. 

    Below is the mutation. Please let me understand the execution process of mutation addressing below queries.

    1."$contvar:String" - what is the input to contvar?Is it a absolute path of file?

    2.type: CONTENT_TRANSFER - What is this type? Should i content the path into Content transfer object?

    mutation ($contvar:String) {
     createDocument(
     repositoryIdentifier:"OS1"
     fileInFolderIdentifier: "/Folder for Browsing"
     documentProperties: {
     name: "Doc with Content"
     contentElements:{
     replace: [
     {
     type: CONTENT_TRANSFER
     contentType: "text/plain"
     subContentTransfer: {
     content:$contvar
     }
     }
     ]
     }

     }
     checkinAction: {}
     )
     {
     id
     name
     }
    }



    ------------------------------
    naresh manukonda
    ------------------------------