This API retrieves the warehouses of a project from Smart Materials. You can either retrieve a single warehouse using warehouse ID or all the warehouses of a project.
Now, you can also retrieve the warehouses that are assigned to the logged in user, by using this URL with an extension.
Retrieve the warehouses 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’)/Warehouses({key})
Specify the values for the project, discipline, language, and key parameter in the URL. The project, discipline, and language together, define the project environment. The key parameter defines the warehouse ID (WhId).
To retrieve all the warehouses of a project, use the following URL:
GET https://{host}/Smat/V1/Projects(‘:project’)/Disciplines(‘:discipline’)/Nls(‘:language’)/Warehouses
Sample Code
GET https://{host}/Smat/V1/Projects(‘DEMO’)/Disciplines(‘PIPING’)/Nls(‘English’)/Warehouses(5007)
Success Response
Status: 200 OK
Content:
{
"@odata.context": "https://in-smatapisp.ingrnet.com/ServicePack/SMAT/V1/$metadata#Projects('DEMO')/Disciplines('PIPING')/Nls('English')/Warehouses",
"value": [
{
"WhId": 5007,
"ProjId": "DEMO",
"WhCode": "CORPORATE",
"UseforIssues": "Y",
"CompanyId": 5000",
"DeChIsWhInd": "N",
"ScrapWhInd": "N",
"NestedPlateInd": "N",
"CorporateWhInd": "Y",
"FreeMaterialWhInd": "N",
"RentalInd": "N"
}]
}
Element |
Description |
Type |
---|---|---|
WhId |
Unique ID of the warehouse |
Integer |
ProjId |
Unique ID of the Project. Retrieved warehouse belongs to this Project. |
String |
WhCode |
Name of the warehouse |
String |
UseforIssues |
Indicates whether the warehouse can be used for material issues and Forecast/Reservation or not? Available values are Y and N. |
String |
CompanyId |
Unique ID of the retrieved company |
Integer |
DeChlsWhInd |
Indicates whether the warehouse can be used for design changes or not? Available values are Y and N. |
String |
ScrapWhInd |
Indicates whether the warehouse can be used as a scrap warehouse or not? Available values are Y and N. |
String |
NestedPlateInd |
Indicates whether the warehouse can be used for nested plate materials or not? Available values are Y and N. |
String |
CorporateWhInd |
Indicates whether the warehouse can be used as corporate warehouse or not? Available values are Y and N. |
String |
FreeMaterialWhInd |
Indicates whether the warehouse can be used as free material issue warehouse or not? Available values are Y and N. |
String |
RentalInd |
Indicates whether the warehouse can be used only for rentals in Material Inventory Reports or not? Available values are Y and N. |
String |
Retrieve warehouses assigned to the logged-in User
You can now retrieve those warehouses that are specifically assigned to the logged in user using this API.
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’)/Warehouses/Com.Ingr.Smat.Vi.AssignedToUser()
Specify the values for the project, discipline, and language in the URL. The project, discipline, and language together, define the project environment.
Sample Code
GET https://{host}/Smat/V1/Projects(‘DEMO’)/Disciplines(‘PIPING’)/Nls(‘English’)/Warehouses/Com.Ingr.Smat.V1.AssignedToUser()
Success Response
Status: 200 OK
{
"@odata.context": "https://in-smatapisp.ingrnet.com/ServicePack/SMAT/V1/$metadata#Warehouses",
"value": [
{
"WhId": 5007,
"ProjId": "DEMO",
"WhCode": "CORPORATE",
"UseforIssues": "Y",
"CompanyId": 5000",
"DeChIsWhInd": "N",
"ScrapWhInd": "N",
"NestedPlateInd": "N",
"CorporateWhInd": "Y",
"FreeMaterialWhInd": "N",
"RentalInd": "N"
}]
}