Parse Joined Data From Upload File
The following will take you step by step to use Parse API.
3. Request body
| Key | Type | Required | Example value | Description |
|---|---|---|---|---|
uploadedFile |
Excel File |
yes |
WELL VOL DAILY.xlsx |
uploadedFile is pre-defined in metadata table BUSINESS_OBJECT and case insensitive |
params |
Json File |
yes |
import.json |
language is required and it is case sensitive and only en value is supported for now |
a. uploadedFile
| Name | Required | Example value | Description |
|---|---|---|---|
Excel sheet name |
yes |
WELL VOL DAILY |
sheet name corresponds to a table name |
Columns |
yes |
UWI |
each column corresponds to a field of table |
Rows |
yes |
OPT-1-205 |
first row corresponds field name, the other data |
Example: WELL VOL DAILY.xlsx
b. params json
| Name | Type | Required | Default value | Example value | Description |
|---|---|---|---|---|---|
boName |
string |
yes |
``WELL VOL DAILY'' |
boName is pre-defined in metadata table BUSINESS_OBJECT and case insensitive. |
|
language |
string |
yes |
``en'' |
language is case sensitive and only en value is supported for now. |
|
timezone |
string |
yes |
``GMT+08:00'' |
timezone is case sensitive. Timezone value only supports specific format GMT+xx:xx, **GMT. |
|
readback |
bool |
no |
false |
TRUE |
Tell the service to return the data in same request. |
offset |
number |
no |
0 |
offset is based index of first record to be read. |
|
limit |
number |
no |
100 |
10000 |
limit is the total number of records to be read for a particular Business Object. |
dspdmUnits |
array |
no |
dspdmUnits list target unit for some of attributes |
Example: params.json
c. Result
{
"status": {
"statusCode": 1,
"statusLabel": "Success"
},
"messages": [],
"exception": {},
"data": {
"WELLBORE": {
"totalRecords": 0,
"parsedValues": {
"totalRecords": 1,
"list": [
{
"type": "WELLBORE",
"id": 748,
"WELLBORE_ID": 748,
"WELL_ID": null,
"WELL_UWI": null,
"WELLBORE_UWI": "HAL-TW00667-PDM00",
...
}
]
},
"dspdmUnits": [
{
"sourceUnit": "dega",
"boAttrName": "X_COORDINATE"
},
{
"sourceUnit": "ft",
"boAttrName": "DRILL_TD"
}
]
},
"WELL": {
"totalRecords": 0,
"parsedValues": {
"totalRecords": 1,
"list": [
{
"type": "WELL",
"id": 1,
"WELL_ID": 1,
"UWI": "HAL-TW00667-PDM",
"WELL_NAME": "TW00667",
...
}
]
},
"dspdmUnits": [
{
"targetUnit": "m",
"sourceUnit": "ft",
"boAttrName": "DEEPEST_DEPTH"
},
{
"targetUnit": "dega",
"sourceUnit": "dega",
"boAttrName": "X_COORDINATE"
}
]
}
},
"version": "0.0.0.0A",
"threadName": "**unknown_18321",
"requestTime": "2021-04-14 14:23:47.578 +08:00",
"responseTime": "2021-04-14 14:24:26.110 +08:00"
}
4. Response
Please see Responses
| Name | Description |
|---|---|
parsedValues |
insert legitimate records from excel into parsedValues |
oldValues |
All the oldValues are either common with pareseValues or invalidValues. |
invalidValues |
Records that meet one of the following criteria are inserted into invalidValues* The value type of the cell is not valid* The value of the cell is null ,but its IS_MANDATORY of the BUSINESS_OBJECT_ATTR table is true* The types of excel cell are different from the types of database field* The length of excel cell data exceeds the limit of database field length* If the record has a parent record (Or reference data record) and parent record id is not found then this record will also be marked as invalid record. In other words if the foreign key value is not recognized from the name. |
bo totalRecords |
parsedValues totalRecords + invalidValues totalRecords |
oldValues totalRecords |
oldValues from paresdValues + oldValues from invalidValues |