Maximo

Maximo

Come for answers, stay for best practices. All we're missing is you.

 View Only
  • 1.  Cannot change asset data with JSON API

    Posted Tue November 29, 2022 09:49 AM
    Hi,

    I'm trying to change asset data with JSON API in Manage 8.8 environment, but can't get it working.

    When I'm POSTing following (using Postman):

    https://masdev.manage.mas1click.x.y/maximo/api/os/mxapiasset/_MTE4NzYvQkVERk9SRA--?lean=1&apikey=xxxxx&Content-type=application/json&x-method-override=PATCH&patchtype=MERGE&properties=*

    Body:
    {
    "description": "Centrifugal Pump 100GPM/60FTHD Changed Description"
    }

    It gives following response:

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

    Authorisation and asset "href" should work, because when I send GET using exactly the same URL, it nicely shows the attributes of the the asset.

    Any ideas, how to get this working?


    ------------------------------
    Hannu Niittymaa
    IBM
    Helsinki
    ------------------------------



    #Maximo
    #MaximoIntegrationandScripting
    #AssetandFacilitiesManagement


  • 2.  RE: Cannot change asset data with JSON API

    Posted Wed November 30, 2022 02:05 AM
    I finally got it working. I had x-method-override and patchtype only in request's parameters, not in headers as they should be.

    ------------------------------
    Hannu Niittymaa
    IBM
    Helsinki
    ------------------------------



  • 3.  RE: Cannot change asset data with JSON API

    Posted Mon May 26, 2025 10:02 AM
    Edited by Sangaiah Nimmala Mon May 26, 2025 10:23 AM
      |   view attached

    Hi Hannu,

    Even i am getting the same error. As suggested in your rersponse i have updated  x-method-override and Patch type in Params instead of header. But i am still getting the same error message. Please find the below rest api url

    https://masdev.manage.inst1.apps.itz-bdtfpi.infra01-lb.dal14.techzone.ibm.com/maximo/api/os/mxasset/_MTE0NTAvQkVERk9SRA--?x-method-override=PATCH&patchtype=MERGE&properties=* 

    Please find the attached screen shot. Can you please help us on what we are missing to get the output?



    ------------------------------
    Sangaiah Nimmala
    ------------------------------



  • 4.  RE: Cannot change asset data with JSON API

    Posted Mon May 26, 2025 11:17 PM

    Try with PUT instead of POST. 



    ------------------------------
    Kushal Desai
    Senior Consulting Manager
    Toronto ON
    ------------------------------



  • 5.  RE: Cannot change asset data with JSON API

    Posted Tue May 27, 2025 12:03 AM

    Hi Kushal,

    Thanks for responding..Even i tried with PUT but i am getting the same error



    ------------------------------
    Sangaiah Nimmala
    ------------------------------



  • 6.  RE: Cannot change asset data with JSON API

    Posted Tue May 27, 2025 01:01 AM

    Hi, I think that x-method-override and Patch type should be in headers, not in params. Also try to use mxapiasset object structure instead of mxasset.



    ------------------------------
    Hannu Niittymaa
    IBM
    Helsinki
    ------------------------------



  • 7.  RE: Cannot change asset data with JSON API

    Posted Tue May 27, 2025 02:40 AM

    Hi Hannu,

    Thanks for the information. It was working now. Everytime we need to give encrypted value like (_MTE0NTAvQkVERk9SRA--) instead of Assetnum in the URL. If we are going to update bulk records how we will do that with this encrypted values?



    ------------------------------
    Sangaiah Nimmala
    ------------------------------



  • 8.  RE: Cannot change asset data with JSON API

    Posted Tue May 27, 2025 03:24 AM

    Hi, you can use also BULK value in x-method-override. Haven't try it by myself, but more info can be found:

    https://ibm-maximo-dev.github.io/maximo-restapi-documentation/crud/bulk



    ------------------------------
    Hannu Niittymaa
    IBM
    Helsinki
    ------------------------------



  • 9.  RE: Cannot change asset data with JSON API

    Posted Tue May 27, 2025 04:03 AM

    Thanks Hannu...Let me check



    ------------------------------
    Sangaiah Nimmala
    ------------------------------