Material Type
The PostAddMaterialType endpoint is responsible for registering a new material type in the MIMS system. This registration can be viewed on screen CAD004.
How to register a material type
HTTP POST Request
| Request Type | Example URL |
|---|---|
| POST | {{url_base}}/PostAddMaterialType |
| Example | http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostAddMaterialType" |
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| MaterialTypeNo | String(25) | Yes | External code of the material type |
| Name | String(40) | Yes | Material type name |
| OverwriteIfExists | Boolean | No | Flag indicating that data should be overwritten if the record already exists |
Return
| Parameter | Type | Required | Description |
|---|---|---|---|
| WebServiceReturn | WebServiceReturn | Yes | Standard WebService response information in method execution |
| MaterialTypeCode | Integer | Yes | Internal Material Type code generated in the MIMS system |
Request Example
curl --location 'http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostAddMaterialType"' \
--header 'Content-Type: application/json' \
--data '{
"MaterialTypeNo": "12345",
"Name": "Tipo Exemplo",
"OverwriteIfExists": true
}'
Response Example
{
"WebServiceReturn": {
"Status": "wrsSuccess",
"ErrorCode": "",
"Message": "",
"Actor": "",
"ReturnQuestion": null
},
"MaterialTypeCode": 29
}
🐞 Possible Errors
| Code | Message |
|---|---|
| AMT‑001 | The provided External Material Type Code parameter (MaterialTypeNo) already exists! |