Hi Arun,
I have this working, mine looks like this:
Headers:
maxauth: myauthkey
Content-Type: application/json
x-method-override: BULK
Then in the body i set some meta data tags:
[
{
"_data":{
"siteid": "ZEN",
"orgid": "BPD",
"inspector": "DeltaTestChannel",
"assetnum": "O3-DIN-SRC_1",
"metername": "CO2",
"newreading": 472.726,
"newreadingdate": "2020-03-02T10:02:57.560Z"
},
"_meta":{
"method": "PATCH",
"patchtype":"MERGE"
}
},
{
"_data":{
"siteid": "ZEN",
"orgid": "BPD",
"inspector": "DeltaTestChannel",
"assetnum": "O3-DIN-SRC_1",
"metername": "HUM",
"newreading": 8.608,
"newreadingdate": "2020-03-02T10:02:57.560Z"
},
"_meta":{
"method": "PATCH",
"patchtype":"MERGE"
},
}
]
Hope that helps with your issue.
----------------------------------------------
Paul Irving
Product Development Manager
BPD Zenith
-----------------------------------------------
------------------------------
Paul Irving
Product Development Lead
BPD Zenith Ltd
------------------------------
Original Message:
Sent: Thu May 21, 2020 08:18 PM
From: Arun Ravindranath
Subject: How to add bulk meter readings in Maximo using REST API
Hi,
We are planning to start using REST API's for our ext systems to send meter readings to Maximo.
I was successfully able to create this API to import single meter reading, but having trouble in receiving them in bulk.
IBM recommends using x-method-override MERGESYNC for importing a single meter reading , and x-method-override BULK for bulk importing records. However, it doesnt seem to accept both headers together for bulk updating of meter readings and only considers the first one that it reads.
We are on 7.6.1 and below is my api info.
URL - maxrest/oslc/os/MXMETERDATA?lean=1
Headers -
properties:*
Content-Type:application/json
x-method-override:MERGESYNC
x-method-override:BULK (is ignored)
if I swap these x-method-override headers, then I see the below error message
"reasonCode": "BMXAA1407E",
"message": "BMXAA1407E - The ASSETMETER object cannot be added because it already exists in the application. An integration message cannot create an object that already exists.",
"statusCode": "400"
Payload
[ { "_data": { "siteid": "siteid", "orgid": "orgid", "assetnum": "3177617", "metername": "ALKALINITY", "newreading": "15", "newreadingdate": "2020-04-20T11:55:20", "inspector": "MAXADMIN", "wonum": "7065662" } }, { "_data": { "siteid": "siteid", "orgid": "orgid", "assetnum": "3177617", "metername": "AEROMONAS", "newreading": "1", "newreadingdate": "2020-04-20T11:55:20", "inspector": "MAXADMIN", "wonum": "7065662" } }]
Thanks
------------------------------
Arun
------------------------------
#Maximo
#AssetandFacilitiesManagement