Headers
Header name |
Description |
Required |
Values |
---|---|---|---|
Authorization |
Access token |
Required |
Bearer <access_token> |
Content-Type |
Request type format |
Required |
application/json |
POST body
Element |
Description |
Type |
Required |
Notes |
---|---|---|---|---|
CommodityCode |
Name of the new commodity code |
String |
Required |
|
ControlStatus |
The control status of the instance |
Integer |
Optional |
Default value is 1 |
CommodityType |
The type of commodity code |
String |
Optional |
Default is TB(Table based). Available commodity types are TB(Table based), AB(Attribute based), CT(Commodity Type), and OT(Other Type). |
StandardName |
Name of the standard |
String |
Optional |
Information about the standard (DIN, ANSI and so on. |
ObjectParameterName |
Name of the object parameter. The id of the part-obj-parm intersection is stored here. |
String |
Optional |
|
NlsId |
Language identifier |
Integer |
Required |
|
ShortDescription |
Short description of the commodity code |
String |
Required |
|
Description |
Descriptive text of the commodity code |
String |
Required |
|
SeqId |
Sequence of the commodity code details. |
Integer |
Optional |
The software automatically sets this value. |
TableDetailId |
A unique ID for the table detail. |
Integer |
Required |
|
UsedForCodeBuilding |
Is the table detail used for building the commodity code? Y or N |
Integer |
Optional |
Default is N (No). |
Sample Request
POST
https://<appserver with domain>/<virtual_directory>/Srd/V2/Projects('SDB')/Disciplines(5020)/Nls(1)/CommodityGroups(5018)/CommodityParts(5549)/CommodityCodes
{
"CommodityCode": "ADDCC_DETAILS",
"ControlStatus": 1,
"CommodityCodeDetails": [
{
"ControlStatus":1,
"TableDetailId": 11670,
"UsedForCodeBuilding": "Y"
}]
}
Response
Parameter |
Description |
Type |
Notes |
---|---|---|---|
CommodityId |
A unique ID for the commodity code. |
Integer |
|
CommodityCode |
Name of the commodity code. |
String |
|
Project |
Project details for the selected commodity code. |
String |
|
DisciplineId |
Discipline ID for the selected project. |
Integer |
|
CommodityType |
Type of commodity code. |
String |
Available commodity types are TB(Table based), AB(Attribute based), CT(Commodity Type), and OT(Other Type). |
StandardName |
Name of the standard |
String |
|
ObjectParameterName |
Name of the object parameter. The id of the part-obj-parm intersection is stored here. |
String |
|
ControlStatus |
Control status of the instance. |
Integer |
|
CommodityGroupId |
The commodity group id of the commodity code. |
Integer |
|
CommodityPartId |
The object parameter that is associated to the group which is used to generate ident. |
Integer |
Sample response
{
"@odata.context":
"https://<appserver with domain>/<virtual_directory>/Srd/V2/$metadata#Projects('SDB')/Disciplines(5020)/Nls(1)/CommodityGroups(5018)/CommodityParts(5549)/CommodityCodes/$entity",
"CommodityId": 111396,
"CommodityCode": "AddCC_Details",
"Project": "SDB",
"DisciplineId": 5020,
"CommodityType": "TB",
"StandardName": null,
"ObjectParameterName": null,
"ControlStatus": 1,
"CommodityGroupId": 5018,
"CommodityPartId": 5549
}
Use the following sample GET method to view the associated commodity code and the Details that you have created:
GET
https://<appserver with domain>/<virtual_directory>/Srd/V2/Projects('SDB')/Disciplines(5020)/Nls(1)/CommodityGroups(5018)/CommodityParts(5549)/CommodityCodes(111395)?$expand=CommodityCodeDetails
Where ?$expand=CommodityCodeDetails is the query to retrieve the associated Details records along with the commodity code.