Skip to main content
8-Gravel
Jul 21, 2025 11:27 AM UTC
Question

Upload Primary Content while Creating a WTDocument through REST API

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?

4 replies

avillanueva
23-Emerald II
Jul 21, 2025 3:03 PM UTC

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. 

Translate
17-Peridot
Jul 22, 2025 6:39 AM UTC

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.

 

https://support.ptc.com/help/windchill/r13.1.1.0/en/index.html#page/Windchill_Help_Center/WCRESTFramework/WCCG_RESTAPIsBatchSupport_examples.html

Translate
8-Gravel
Jul 23, 2025 9:35 AM UTC

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

Translate
17-Peridot
Aug 12, 2025 1:54 PM UTC

@OP_11714882 But with single steps it works? The batch process is a pain, I know that. 

Translate