Upload a file in an Open MTO Interface - Intergraph Smart Materials - Version 2017 R2 (2.2) - Help - Hexagon

Intergraph Smart Materials Web API Help 2017 R2 (2.2)

Language
English
Product
Intergraph Smart Materials
Subproduct
Web API
Search by Category
Help
Version Smart Materials Web API
2017 R2 (2.2)

This API uploads a new file in an existing OMI Import job.

  • Only two formats can be uploaded: CSV and XLSX, and Status of the OMI Import job must be New.

  • File gets uploaded in the DB server so specify the physical path of DB server to DBA setting BOM_IMPORT_PATH, where you want to upload the import file.

  • Only the first sheet of the uploaded file is considered for the BOM Import process.

Required Privilege: API_BOM

Headers

Header Name

Description

Required

Values

Authorization

Access token

Required

Bearer <access_token>

Content-Type

Request type format

Required

application/JSON

Body

URL Format: https://localhost:49717/smat/v1/Projects(':project')/Disciplines(':discipline')/Nls(':language')/OMIImportJobs({key})/UploadFile()/

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 OMI Import job Id (OMIJId).

  • If uploaded file is XlSX, it gets converted to CSV first, and then saved in database.

  • To scan the file, you must provide Scan Engine URL in the DBA setting UPLAOD_FILE_SCAN_ENG_URL.

  • Uploaded file is scanned, and then saved in the database path (BOM_IMPORT_PATH), based on the DBA setting (API_FILE_SCAN_ENABLE).

    • If API_FILE_SCAN_ENABLE is set to Y, uploaded file is scanned, and then saved in the database path.

    • If API_FILE_SCAN_ENABLE is set to N, uploaded file is saved in the database path without scanning.

  • Scanned file results are logged in file SCAN_OMIJID<ID>_<date_time> created in the path provided in the DBA setting BOM_IMPORT_PATH.

Element

Description

Type

Required

Notes

OMIJId

Unique ID of the OMI Import job which you want to clone

Integer

Required

Maximum allowed length is 12.

FileType

Type of the uploaded file

String

Required

Only CSV and XLSX files are supported.

Data

File data

Binary

Required

Sample Code

POST https://localhost:49717/smat/v1/Projects('RS')/Disciplines('PIPING')/Nls('English')/OMIImportJobs(10000016579)/UploadFile()/

{

"bomFile":{

"FileType" : "CSV",

"Data": {bytes}

}

}

Success Response

Status: 200 Created.