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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Translate the entire conversation x

Fetch BOM Data from WRS

EC_10581209
12-Amethyst

Fetch BOM Data from WRS

I am using Windchill PDMLink Release 12.1 and Datecode with CPS 12.1.1.0

Trying to fetch BOM data with ID e.g.OR:wt.part.WTPart:455420, in the WRS Domain under Product Management Domain under POST GetBOM i enter Parameters and CSRF TOKEN from /servlet/odata/PTC/GetCSRFToken()
the Parameters
Name Description
$select
string
(query)
$select
$expand
string
(query)
Components($expand=Part($select=Name,Number),PartUse,Occurrences;$levels=max)
CSRF_NONCE *
string
(header)
wq4/k91jTdavRJ8Olv9d34oJDJLcCNM5s4FQ37gbFbObF/hh+pgU+ocrf73iE647gcNW1vIIfeuVdag68ZsHq+1Te+6ZcKVD9MgO9q8Nda/VEKp9p5xwyqlUKJnnfMVHl95c9u87err1D9NMgMplqqsAcA==
PartId *
string
(path)
OR:wt.part.WTPart:455420
body *
object
(body)
Edit Value
Model
{
"navigationCriteriaId": ""
}
and click execute

Here are the errors that I faced
when i paste the link in the POSTMAN I am getting error
{
"error": {
"code": null,
"message": "The syntax of the JSON document is not valid."
}
}
ACCEPTED SOLUTION

Accepted Solutions

I will share the steps for postman:

 

1, Get latest CSRF NONCE

URL: http://<server>:80/Windchill/servlet/odata/PTC/GetCSRFToken()

Request Type: GET

Only Authorization tab needed to be filled in Postman

amansomgade_0-1743717282113.png

Copy the Nonce Vale

 

2. Get the OID for Part

URL: http://<server>:80/Windchill/servlet/odata/ProdMgmt/Parts?ptc.search.latestversion=true&$filter=View eq 'Design' and Number eq 'DQ001'

Request Type: GET

Only Authorization tab needed to be filled in Postman

amansomgade_1-1743717430558.png

Copy the part ID

 

3. Exceute the Get BOM

URL: http://<server>:80/Windchill/servlet/odata/v4/ProdMgmt/Parts('OR:wt.part.WTPart:2230714')/PTC.ProdMgmt.GetBOM?$expand=Part,PartUse,Occurrences

Request Type: POST

Replace the Part ID in step 3 url as fecthed in step 2

Authorization tab needed to be filled in Postman

Also, add a parameter as CSRF_NONCE with value as fetched in step 1 in the headers tab in Postman as shown below

amansomgade_2-1743717634892.png

Give the body as {} in the Body tab in Postman as shown below

amansomgade_3-1743717687968.png

Then execute the request to get the result.

amansomgade_4-1743717747203.png

 

View solution in original post

6 REPLIES 6
Fadel
22-Sapphire III
(To:EC_10581209)

I guess you need a nab critera (Filter) , take a look at https://www.ptc.com/en/support/article/CS299749 

Fede
EC_10581209
12-Amethyst
(To:Fadel)

Is the Navigation Criteria even neccassary?

Remove Nav criteria and keep the body blank.

Try this URL:

https://<serverName>/Windchill/servlet/odata/v4/ProdMgmt/Parts('OR:wt.part.WTPart:455420')/PTC.ProdMgmt.GetBOM?$expand=Components($expand=Part,PartUse,Occurrences;$levels=max)

 

The Rest API PTC.ProdMgmt.GetBOM is deprecated and can only be used in REST v4

like this 

EC_10581209_0-1743711767893.png

cannot delete the exclamation

POSTMAN i get this

EC_10581209_1-1743711847083.png

the issue remains, or did I type something wrong

 

Regards

I will share the steps for postman:

 

1, Get latest CSRF NONCE

URL: http://<server>:80/Windchill/servlet/odata/PTC/GetCSRFToken()

Request Type: GET

Only Authorization tab needed to be filled in Postman

amansomgade_0-1743717282113.png

Copy the Nonce Vale

 

2. Get the OID for Part

URL: http://<server>:80/Windchill/servlet/odata/ProdMgmt/Parts?ptc.search.latestversion=true&$filter=View eq 'Design' and Number eq 'DQ001'

Request Type: GET

Only Authorization tab needed to be filled in Postman

amansomgade_1-1743717430558.png

Copy the part ID

 

3. Exceute the Get BOM

URL: http://<server>:80/Windchill/servlet/odata/v4/ProdMgmt/Parts('OR:wt.part.WTPart:2230714')/PTC.ProdMgmt.GetBOM?$expand=Part,PartUse,Occurrences

Request Type: POST

Replace the Part ID in step 3 url as fecthed in step 2

Authorization tab needed to be filled in Postman

Also, add a parameter as CSRF_NONCE with value as fetched in step 1 in the headers tab in Postman as shown below

amansomgade_2-1743717634892.png

Give the body as {} in the Body tab in Postman as shown below

amansomgade_3-1743717687968.png

Then execute the request to get the result.

amansomgade_4-1743717747203.png

 

I accepted your reply as solution and in your proposal i've found my mistake 

I forgot to put exclamation to Body tab

EC_10581209_0-1743750816775.png

 

Announcements
Top Tags