DownloadCADPath
Introduction
This API provides a CAD file (or several, depending on the CAD format and the type of product).
New version
API Key
This web service requires an API Key. Please refer to this chapter to request your API Key.
Description
The API returns one or several CAD files depending on the CAD format and the type of product. It also provides all files in one single zip file.
Building a URL
The DownloadCADPath API request takes the following form:
http://ws.tracepartsonline.net/tpowebservices/DownloadCADPath?parameters
Parameters
Certain parameters are required while others are optional. As it is standard in URLs, all parameters are separated using the ampersand (&) character. The list of parameters and their possible values are enumerated below.
Required parameters
Parameter Name |
Data type |
Default value |
Description |
ApiKey |
string |
none |
Code calling an API to track and control how the API is used |
UserEmail |
string |
none |
User email / User ID |
Format |
string |
none |
Answer file type (xml, json or csv) |
Language |
string |
en |
LanguageID given by the LanguagesList API |
PartID* |
string |
none |
PartID given by the SynchronizationData API |
SelectionPath* |
string |
none |
SelectionPath given by the SynchronizationData API |
ClassificationID** |
string |
none |
CatalogID given by the CatalogsList API |
PartNumber** |
string |
none |
Part Number as it is exactly written in the TraceParts database |
CADFormatID |
real |
none |
CADFormatID given by the CADFormatsList API |
* Both parameters (PartID and SelectionPath) have to be used together. In this case, the couple “ClassificationID” and “PartNumber” is not to use.
** Both parameters (ClassificationID and PartNumber) have to be used together. In this case, the couple “PartID” and “SelectionPath” is not to use.
Optional parameters
Parameter Name |
Data type |
Default value |
Description |
Asynchronous |
boolean |
0 |
Requests for a CAD file and checks if the CAD file is ready with the JobID parameter |
JobID |
string |
none |
Checks if the CAD file creation, requested with the asynchronous parameter, is done |
NoTXTFile |
boolean |
0 |
Removes the .txt file which contains the Bill Of Materials |
ActiveJsonLight |
boolean |
0 |
Enables the light version when json is the answer file type |
Example of DownloadCADPath API
The request below returns the CAD files for the part number 43900011 from the catalog ASCO Numatics in Autodesk Inventor CAD format.
PartID and SelectionPath:
http://ws.tracepartsonline.net/tpowebservices/DownloadCADPath?UserEmail=test@test.com&PartID=10-17102002-114249&SelectionPath=1|1|1|1|=0|&CADFormatId=9&Language=en&Format=xml&ApiKey={ApiKey}
PartNumber and ClassificationID:
http://ws.tracepartsonline.net/tpowebservices/DownloadCADPath?UserEmail=test@test.com&PartNumber=43900011&ClassificationID=ASCO_JOUCOMATIC&CADFormatId=9&Language=en&Format=xml&ApiKey={ApiKey}
By adding the Asynchronous parameter, DownloadCADPath returns a JobID (here, in Json file):
http://ws.tracepartsonline.net/tpowebservices/DownloadCADPath?UserEmail=test@test.com&PartID=10-17102002-114249&SelectionPath=1|1|1|1|=0|&CADFormatId=9&Language=en&Format=json&Asynchronous=1&ApiKey={ApiKey}
By using the asynchronous mode, you can check and have the path to the CAD file by using the JobID:
http://ws.tracepartsonline.net/tpowebservices/DownloadCADPath?UserEmail=test@test.com&Language=en&Format=json&Asynchronous=1&JobID=43488246&ApiKey={ApiKey}
DownloadCADPath responses
DownloadCADPath responses are returned in the format indicated by the Format parameter within the URL request’s path.
JSON Output
The HTTP request is shown below, displaying the CAD files.
[ [[ "43488976", "True", "False", ]], [[ "Archive", "http://ws.tracepartsonline.net/CADFiles/43488976-9-25f.zip" ], [ "PrimaryCADFile", "http://ws.tracepartsonline.net/CADFiles/43488976-9-25f/25f.ipt" ], [ "BOMFields", "http://ws.tracepartsonline.net/CADFiles/43488976-9-25f/25f.txt" ] ]]
XML Output
Same example as above.
<ArrayOfArrayOfanyType> <ArrayOfanyType> <anyType xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">43489380</anyType> <anyType xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">True</anyType> <anyType xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">False</anyType> </ArrayOfanyType> </ArrayOfArrayOfanyType> <ArrayOfArrayOfanyType> <ArrayOfanyType> <anyType xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">Archive</anyType> <anyType xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">http://ws.tracepartsonline.net/CADFiles/43489380-9-25f.zip</anyType> </ArrayOfanyType> </ArrayOfArrayOfanyType> <ArrayOfArrayOfanyType> <ArrayOfanyType> <anyType xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">PrimaryCADFile</anyType> <anyType xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">http://ws.tracepartsonline.net/CADFiles/43489380-9-25f/25f.ipt</anyType> </ArrayOfanyType> </ArrayOfArrayOfanyType> <ArrayOfArrayOfanyType> <ArrayOfanyType> <anyType xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">BOMFields</anyType> <anyType xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">http://ws.tracepartsonline.net/CADFiles/43489380-9-25f/25f.txt</anyType> </ArrayOfanyType> </ArrayOfArrayOfanyType>
DownloadCADPath response elements
DownloadCADPath responses contain five elements:
- “JobID”: ID of your request as described before in the list of parameters.
- “CAD file status”: if the returned value is “False”, the CAD file is not ready. If the returned value is “True”, the CAD file is ready and the path is given in the next elements.
- “CAD file error”: if the value is “True”, an error occured during the creation of the file for many reasons. The TraceParts team will be aware about this error.
- “Type”: it can take 4 values. “Archive” for the zip file containing all CAD files. The following types depend on the settings of your API key. They are not available by default: “PrimaryCADFile” for the main CAD file. “SecondaryCADFile” for the sub CAD files (optional). “BOMFields” for the txt file which contains the BOM attributes (optional with the “NoTXTFile” parameter).
- “Path”: it is the URL for the file. The file is stored on the server for 6 hours. It must not be HTML encoded.
Developer support
Please contact us for any problems, questions or comments related to this web service.
Last updated September 7, 2020