This API retrieves the commodity codes of a project from Smart Materials. You can either retrieve a single commodity code using commodity Id or all the commodity codes of a project.
Required Privilege: API_READONLY
Headers
Header Name |
Description |
Required |
Values |
---|---|---|---|
Authorization |
Access token |
Required |
Bearer <access_token> |
Content-Type |
Request type format |
Required |
application/JSON |
Body
URL Format: GET https://{host}/Smat/V1/Projects(‘:project’)/Disciplines(‘:discipline’)/Nls(‘:language’)/Commodities({key})
Specify values for the project, discipline, language, and key parameter in the URL. The project, discipline, and language together, define the project environment and the key parameter defines the commodity Id (CommodityId).
To retrieve all the commodity codes of a project, use the following URL:
GET https://{host}/Smat/V1/Projects(‘:project’)/Disciplines(‘:discipline’)/Nls(‘:language’)/Commodities
Sample Code
GET https://{host}/Smat/V1/Projects(‘RS’)/Disciplines(‘PIPING’)/Nls(‘English’)/Commodities(924526)
Success Response
Status: 200 OK
Content:
{
"@odata.context": "https://{host}/Smat/V1/$metadata#Projects('RS')/Disciplines('PIPING')/Nls('English')/Commodities",
"value": [
{
"CommodityId":924526,
"ProjId":"PG",
"CommodityCode":"154102DX75R8HNSV",
"PartId":5536,
"CommodityType":"AB"
}]
}
Element |
Description |
Type |
---|---|---|
CommodityId |
Unique ID of the retrieved commodity code |
Integer |
ProjId |
Unique ID of the Project. Retrieved commodity code belongs to this Project. |
String |
CommodityCode |
Name of the commodity code |
String |
PartId |
Unique ID of the commodity part of the retrieved commodity code |
Integer |
CommodityType |
Type of the commodity code. Available types are:
|
String |