Is there a way to use the rest api to get a list of all wtparts and their attributes?
You can get parts and their attributes but there does seem to be a limit for how many parts in a single query.
I can get 140,000 parts with query for a part Numbers containing 'M', but if I make the criteria and broader I get an error, so suspecting the limit is 200,000.
Yes this is a silly problem that we're also struggling with.
So ther requirement is to give Windchill a list of part number and then it needs to bring properties back of all the WTparts that was listed
Tried it via a saved Search Query endpoints supplying part number via KeyWord parameter but for some reasons it omits some parts in the response so doing it via SavedSearch End Point does not work correct. If I run the exact save query in Windchill Front end I get correct list:
Is it possible to get WTParts out of Windchill with Rest API specifiying the list of WT parts?
You can use a QB parameter and pass in a part number, then QB can report the attributes that you need. Use a python script to call this QB report repeatedly, once per part.
The python script is not difficult, but I don't have time at the moment to give the details.
Something like this to run a QB report:
# returns TSV or XML or XSL text static_p = ('servlet/WindchillAuthGW/wt.enterprise.URLProcessor/' 'URLTemplateAction?' 'Item+Name=Foo-T%2A&' 'format=formatCustom&' 'xsl2=&' 'SET_QUERY_LIMIT=20000&') if format == 'XML': format_xsl = 'identity.xsl' elif format == 'TSV': format_xsl = 'tsvFormat.xsl' sURL = self.wc_url + static_p sURL += ('xsl1=templates/reports/' + format_xsl + '&' + 'oid=OR%3Awt.query.template.ReportTemplate%3A' + str(report_ID) + '&' + parm_txt + 'action=ExecuteReport') return self.send_to_Windchill(sURL, expect_JSON=False)
parm_txt = 'PartNumber=' + p_number + '&'
I find the TSV format more useful. cheers -- R