cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Translate the entire conversation x

Upload Primary Content while Creating a WTDocument through REST API

OP_11714882
7-Bedrock

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 4

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.

 

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

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. 

Announcements
Top Tags