Maximo

 View Only
  • 1.  How to add bulk meter readings in Maximo using REST API

    Posted Thu May 21, 2020 08:18 PM
    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


  • 2.  RE: How to add bulk meter readings in Maximo using REST API

    IBM Champion
    Posted Fri May 22, 2020 03:54 AM
    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
    ------------------------------



  • 3.  RE: How to add bulk meter readings in Maximo using REST API

    Posted Sat May 23, 2020 07:46 AM
    Edited by System Wed March 22, 2023 11:44 AM
    Hi Paul,

    Adding _meta tags did the trick. I am able to update multiple readings now. Thank you so much :)

    ------------------------------
    Arun Ravindranath
    ------------------------------



  • 4.  RE: How to add bulk meter readings in Maximo using REST API

    Posted Sun May 24, 2020 05:46 PM
    Hi Paul. your solution solved my problem. tanks

    ------------------------------
    Anzali Market
    ------------------------------



  • 5.  RE: How to add bulk meter readings in Maximo using REST API

    Posted Mon November 08, 2021 10:03 AM
    For completion - Worth emphasizing that when updating an object, the `data` element must contain a `uri` attribute pointing to the right object.

    ------------------------------
    ROY ABITBOL
    ------------------------------



  • 6.  RE: How to add bulk meter readings in Maximo using REST API

    Posted Fri October 14, 2022 08:59 AM
    Hi Paul,

    We are working on Maximo 7.6.1.2. I am trying to import the bulk meter readings using below details

    url-   POST maximo/oslc/os/mxmeterdata?lean=1

    headers used:
    properties: *
    Content-Type: application/json
    x-method-override: BULK
    Authorization: Basic xxxxxxxxxxxx

    Json body :
    [
        {
            "_data":{
                "siteid""abcd",
                "orgid""xyz",
                "inspector""MAXADMIN",
                "assetnum""abcd140",
                "metername""RUNHOURS",
                "newreading"472726.90,
                "newreadingdate""2022-10-12T10:02:57.560Z"
            },
            "_meta":{
                "method""PATCH",
                "patchtype":"MERGE"
                
            }
        },
        {
            "_data":{
                "siteid""abcd",
                "orgid""xyz",
                "inspector""MAXADMIN",
                "assetnum""abcd139",
                "metername""RUNHOURS",
                "newreading"897658,
                "newreadingdate""2022-10-02T10:02:57.560Z"
            },
            "_meta":{
                "method""PATCH",
                "patchtype":"MERGE"
            }
        }]

    I see below error message when trying the HTTP post 

    {
        "Error": {
            "reasonCode"null,
            "message""oslc#expectedobjgotarray",
            "statusCode""400"
        }

    we have even tried to import at least one meter reading instead of bulk 

    url-   POST maximo/oslc/os/mxmeterdata?lean=1

    headers used:
    properties: *
    Content-Type: application/json
    x-method-override: SYNC
    Authorization: Basic xxxxxxxxxxxx

    Json body :
    {
                "siteid""abcd",
                "orgid""xyz",
                "inspector""MAXADMIN",
                "assetnum""abcd10340",
                "metername""RUNHOURS",
                "newreading"472726.90,
                "newreadingdate""2022-10-12T10:02:57.560Z"
            }

    I am unable to import one reading as well using maximo/oslc/os 

    I am getting below error message here 

            "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"

    Can you help me here 

    Thanks,
    Nithun


    ------------------------------
    Nithunveer Rampally
    ------------------------------