Create MTR Header - Intergraph Smart Materials - Version 2017 (2.0) - Help - Hexagon PPM

Intergraph Smart Materials Web API Help 2017 (2.0)

PPMProduct
Intergraph Smart Materials
PPMCategory_custom
Help

Name and Description

TransferHeaders – This API creates an MTR header in Smart Materials.

URL Format

/Projects (':project')/Disciplines(':discipline')/Nls(':language')/TransferHeaders

Specify values for project, discipline, and language parameters in the URL. These three values together define a project environment in which the MTR header is created.

Use the following read-only APIs to get the available values for each parameter.

/Projects,

/projects(':project')/Disciplines,

/projects(':project')/Disciplines(':discipline')/nls

URL Parameter

:project, :discipline, :language

Method

POST

Required Privilege

API_CREATE_MTRHEADER

Data Parameter

The payload of the request should be in JSON format with the following structure:

<EntityType Name="MaterialTransferHeader">

<Key>

<PropertyRef Name="Key"/>

</Key>

<Property Name="Key" Type="Edm.Int64" Nullable="false"/>

<Property Name="MtrNumber" Type="Edm.String"/>

<Property Name="MtrCreateDate" Type="Edm.DateTimeOffset"/>

<Property Name="TransferDate" Type="Edm.DateTimeOffset"/>

<Property Name="EtaDate" Type="Edm.DateTimeOffset"/>

<Property Name="BnlId" Type="Edm.Decimal"/>

<Property Name="WhId" Type="Edm.Decimal" Nullable="false"/>

<Property Name="TransferedBy" Type="Edm.String"/>

<Property Name="ShipperRef" Type="Edm.String"/>

</EntityType>

Where:

MtrNumber (Edm.String): It is an optional value. In the absence of this value, system will generate the MTR number as per the MTR rule set for the logged in user. The acceptable value is a string of maximum 50 characters.

MtrCreateDate (Edm.DateTimeOffset): It is an optional value. In the absence of this value, system will use system date. The acceptable value is a date in the format of "YYYY-MM-DD".

TransferDate (Edm.DateTimeOffset): It is an optional value. In the absence of this value, system will use system date. The acceptable value is a date in the format of "YYYY-MM-DD".

EtaDate (Edm.DateTimeOffset): It is an optional value. The acceptable value is a date in the format of "YYYY-MM-DD".

BnlId (Edm.Decimal): Bin location id is an optional value. Use following Read Only API to list the bin locations.

https://{host}/Smat/V1/Projects(‘:project’)/Disciplines(‘:discipline’)/Nls(‘:language’)/BinLocations

WhId (Edm.Decimal and Not Nullable) Warehouse Id is a mandatory value.

/Projects('{project}')/Disciplines('{discipline}')/Nls('{nls}')/BinLocWarehouses

TransferedBy (Edm.String): It is an optional value.

ShipperRef (Edm.String): It is an optional value.

Example:

{

"WhId":6661,

"BnlId":5300,

"MtrCreateDate":"2016-05-28",

"TransferDate":"2016-05-28",

"EtaDate":"2016-06-28",

"TransferedBy":"RW",

"ShipperRef":"Shipper-Ref-001"

}

Success Response

HTTP status code sent back to client on the API execution success: 
Code: 200 OK

Content:

{

"@odata.context": " https://{host}/Smat/V1/$metadata#Edm.Int64",

"value": 10000007995

}

Error Response

This API may fail with the following error messages:

Error Code: 401 Unauthorized

Content:

{

"error": {

"code": "",

"message": "Authorization has been denied for this request." }

}

HTTP Status Code: 400 Bad Request

Content:

{

"error": {

"code": "",

"message": "Invalid/Missing input JSON data. Please refer metadata" }

}

HTTP Status Code: 400 Bad Request

Content:

{

"error": {

"code": "",

"message": "The request is invalid.",

"innererror": {

"message": "materialTransferHeader.MatlTransferRpt : The MatlTransferRpt field is required.\r\nThe field MatlTransferRpt is invalid.\r\n",

"type": "",

"stacktrace": "" }

}

}

HTTP Status Code: 400 Bad Request

Content:

{

"error": {

"code": "",

"message": "The request is invalid.",

"innererror": {

"message": "materialTransferHeader.MatlTransferRpt.WH_ID : The WH_ID field is required.\r\n",

"type": "",

"stacktrace": "" }

}

}

Notes

After creating MTR Header, NLS description can be added using HeaderNls.