Skip to main content
12-Amethyst
April 2, 2025
Solved

Fetch BOM Data from WRS

  • April 2, 2025
  • 1 reply
  • 1062 views
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."
}
}
    Best answer by aman.somgade

    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

     

    1 reply

    Fadel
    23-Emerald I
    April 2, 2025

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

    Buiꓘa
    12-Amethyst
    April 3, 2025

    Is the Navigation Criteria even neccassary?

    12-Amethyst
    April 3, 2025

    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