Maximo

 View Only
  • 1.  Maximo REST API JSON

    Posted 15 days ago

    External system will be calling maximo rest API and they wanted to have output in specific JSON fromat as given below.

    We have created one custom object called N_TRANSCO, and created objectstructure with 5 objects and main object is ASSETMETER

    So formed REST URL is - https://enova-int.rec.net.intra.laposte.fr/maxrest/rest/os/N_COCOMA_KAFKA_OS/?READINGDATE=~gt~2024-05-01T13:44:04&_format=json&compact=1" href="https://enova-int.rec.net.intra.laposte.fr/maxrest/rest/os/N_COCOMA_KAFKA_OS/?READINGDATE=~gt~2024-05-01T13:44:04&_format=json&compact=1" rel="noreferrer noopener" target="_blank" class="fui-Link ___1rxvrpe f2hkw1w f3rmtva f1ewtqcl fyind8e f1k6fduh f1w7gpdv fk6fouc fjoy568 figsok6 f1hu3pq6 f11qmguv f19f4twv f1tyq0we f1g0x7ka fhxju0i f1qch9an f1cnd47f fqv5qza f1vmzxwi f1o700av f13mvf36 f1cmlufx f9n3di6 f1ids18y f1tx3yz7 f1deo86v f1eh06m1 f1iescvh fhgqx19 f1olyrje f1p93eir f1nev41a f1h8hb77 f1lqvz6u f10aw75t fsle3fq f17ae5zn" title="https://enova-int.rec.net.intra.laposte.fr/maxrest/rest/os/n_cocoma_kafka_os/?readingdate=~gt~2024-05-01t13:44:04&_format=json&compact=1">hostname/maxrest/rest/os/OSName/?READINGDATE=~gt~2024-05-01T13:44:04&_format=json&compact=1

    But We are not able to format JSON response in below format, they want to give the object data in every tag named as objectname also one tag anmed 'criteria' under N_TRANSCO object tag in which they want us to give data from 3 different objects.

    How can we achieve this? They want it through rest API only

     

    They will be filtering our rest with readingdate/eventdate

    {"member":[{
       "ASSET":
          {
             "uuid":ASSET.N_FACTURAID_SYSDATE_SYSTIME,
             "contractNumber":ASSET.N_CONTRACT,
             "cdrCode":ASSET.ITEMNUM,
             "quantity":ASSET.N_NBDEPLISTOTAL
             
          },
       
       "LOCATIONS":
          {
             "custAccNumber":LOCATIONS.PLUSPCUSTOMER
          },
       
       "ASSETMETER":
          {
             "eventDate":ASSETMETER.LASTREADINGDATE
          },  
         
       
       "N_TRANSCO":
          {
             "offerCode":N_TRANSCO.OFEERCODE
             "productCode":N_TRANSCO.PRODUCTCODE,
             "criteria":{
                "machineNumber":ASSET.N_FACTURA_ID,
                "weightCategory":N_TRANSCO.WeightCategory,
                "overseas1Flag":N_TRANSCO.overseas1Flag,
                "overseas2Flag":N_TRANSCO.overseas2Flag,
                "sender_zone":N_TRANSCO.sender_zone
                "totalPrice":ASSET.N_MONTANT,
                "depositZone":ASSET.N_DEPOTAREA,
                "destinationZone":""
             }
          }, 
          
       
       "paging":{
          "total_results":1
       }
    }
    ]
    }



    ------------------------------
    Sunil Andhale
    ------------------------------


  • 2.  RE: Maximo REST API JSON

    Posted 14 days ago

    You really shouldn't be building new integrations using the legacy 7.1 REST API approach. That code is not being enhanced at this point and the JSON REST API provides a ton of additional capabilities. Some documentation: https://ibm-maximo-dev.github.io/maximo-restapi-documentation/ &  https://community.ibm.com/community/user/asset-facilities/viewdocument/maximos-rest-api-aka-json-api-os?CommunityKey=ed77c224-45e2-47b0-b574-cc31496f9a41&tab=librarydocuments


    What you want to look at is the JSON Mapping application in Maximo. This is the out of the box way to transform messages into a particular format to support another system. You would create a sample JSON payload to start the process and then map that to the desired attributes. 



    ------------------------------
    Steven Shull
    ------------------------------