Content Management and Capture

Content Management and Capture

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

 View Only
Expand all | Collapse all

Postman example for Graph API, add a document with content

  • 1.  Postman example for Graph API, add a document with content

    Posted Tue December 23, 2025 12:33 PM

    Hi, I am assisting a group that is insisting on using postman as a unit - development tool so my regular programming IDE's won't help. I provided a working mutation that adds a document without content, per IBM guide a second call/step is made for the multi part content upload which returns an error. Now in our regular WSI APIs content must accompany the create document, I get it but Graph is different.  Most likely this is a misunderstanding or lack of knowledge in setting the content within postman.  Is there anyone in this group that has used postman with graph to upload a document with content to P8 that can share the 'how to' to get this done?  Much appreciated!!  



    ------------------------------
    Jay Bowen
    www.bowenecmsolutions.com
    Medina, OH
    ------------------------------


  • 2.  RE: Postman example for Graph API, add a document with content

    Posted Wed December 31, 2025 02:17 PM

    When using postman with the GraphQL API, you can do most operations using the GraphQL pane on postman.  Creating a document with content, however, is the exception.  For that, you must use the form-data pane.

    Here is some screen shots of what it looks like

    image
    Here are the details of the graphql query
    image
    Here is the text of the graphql query that you can copy:
    {"query":"mutation ($contvar:String) {
      createDocument(
        repositoryIdentifier:\"{{OS}}\" 
        fileInFolderIdentifier: \"{{folder}}\"
        classIdentifier: \"Document\"
        documentProperties: {
          name: \"test base Document with content\"
          properties:[ {DocumentTitle: \"DocName5\"}]
          contentElements:{
            replace: [
              {
                type: CONTENT_TRANSFER 
                subContentTransfer: {
                  content:$contvar
                }
              } ]
          } 
        }
        checkinAction: {} 
      )
      { id name }
     }"}, "variables":{"contvar":null}
    For the contvar parameter, click on the cloud icon to upload a file from your local machine
    Here are some additional links on uploading and downloading content using the GraphQL API
    • https://www.ibm.com/docs/en/filenet-p8-platform/5.7.0?topic=mutations-uploading-content
    • https://github.com/ibm-ecm/ibm-content-platform-engine-samples/tree/master/CS-GraphQL-javascript-samples
    • https://community.ibm.com/community/user/blogs/david-hanson/2024/01/24/graphql-support-download-upload-large-content


    ------------------------------
    ROGER Bacalzo
    ------------------------------