Maximo

 View Only
Expand all | Collapse all

Cannot change asset data with JSON API

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