Maximo Open Forum

 View Only
  • 1.  Error while updating Maximo records using REST API and Postman

    Posted 18 days ago
    Hi All,
    I have been trying to test the Maximo REST API for updating records and receiving this following error:
    Error":{"reasonCode":null," message":"oslc#update_on_createuri", "statusCode":"400"}"

    Using OOB Object Structure: MXAPIINVBAL

    JSON Message:
    {
    "_action": "AddChange",
    "reconciled": true,
    "physcnt": 9.0,
    "binnum": "A-5-8",
    "orgid": "EAGLENA",
    "itemnum": "117041",
    "curbal": 6.0,
    "itemsetid": "SET1",
    "siteid": "BEDFORD",
    "location": "CENTRAL",
    }

    I was trying to update the current balance of an item in an existing bin and not able to do it but I could create a new bin and add current balance.
    I have been using Postman to post the JSON message and using the POST method with following headers:
    x-method-override: "PATCH"
    patchtype: "MERGE"
    properties: "*"
    Content-Type: "application/json"
    _lean=1

    I am not sure where am I doing wrong and any help would be appreciated.
    #Customizations
    #EverythingMaximo
    #Integrations

    ------------------------------
    Harshavardhan Kamepalli
    Accenture
    ------------------------------


  • 2.  RE: Error while updating Maximo records using REST API and Postman

    Maximo Certified
    Posted 18 days ago

    The headers of x-method-override of PATCH & patchtype of MERGE means that you're updating the record and would be providing the href of the record to update. The error you got is when you are not providing the href. 

    Depending on your version of Maximo, there are two other options. To use the _action: AddChange that's typically going to be used when you use the bulk API. To do that you would have x-method-override as BULK (with no patchtype) and you provide your data as an array of values (IE wrap your JSON object with [ ]). 

    You can also use the x-method-override of SYNC and patchtype of MERGE if you don't want to provide the href and intend to add or update a single record. You would not provide the _action in the request in this scenario. 



    ------------------------------
    Steven Shull
    IBM
    ------------------------------



  • 3.  RE: Error while updating Maximo records using REST API and Postman

    Posted 17 days ago

    Thanks Steven, 
    Using x-method-override: SYNC worked for me for updating a single record.
    I'll try the BULK method for multiple records.



    ------------------------------
    Harshavardhan Kamepalli
    Accenture
    ------------------------------



  • 4.  RE: Error while updating Maximo records using REST API and Postman

    Posted 16 days ago

    Hi Steven,

    Is there a way to pass {"_action": "AddChange"} in the URL parameters or as Header instead of passing it in JSON request itself?



    ------------------------------
    Harshavardhan Kamepalli
    Accenture
    ------------------------------