Skip to main content
8-Gravel
July 21, 2025
Question

Upload Primary Content while Creating a WTDocument through REST API

  • July 21, 2025
  • 2 replies
  • 575 views

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?

2 replies

avillanueva
23-Emerald I
23-Emerald I
July 21, 2025

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. 

17-Peridot
July 22, 2025

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

8-Gravel
July 23, 2025

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

17-Peridot
August 12, 2025

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