Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Version: Windchill 12.1
Use Case: Upload Primary Content while creating WTDocument through REST endpoint
Description:
I'm able to create a WTDocument by using the POST REST Endpoint, but now while I create the document, I also want to upload primary content through the same endpoint, is there any way to upload primary content while simultaneously creating the Document?
I am no expert. We have a Customization area for these questions. Seems like Knowledge base has lots of articles on this:
https://www.ptc.com/en/support/article/CS18364?source=search
From what I know, its a multi-step process. Create the document, upload the file and linked it to the document.
I never tried it, but with a batch process you should be able to create and upload the WTDocument in a single rest call. Unfortunately the olingo / odata batch process syntax is not that easy like creating a normal rest call and post a json.
I tried creating a batch process but I'm unable to use the ReplicaUrl which i get from UploadStage1Action as a POST url in the next step
@OP_11714882 But with single steps it works? The batch process is a pain, I know that.