Maximo Integration

  • 1.  Maximo Next Gen Json REST API - RESTID

    Posted Tue March 02, 2021 11:52 PM
    Hi Experts,

    I understand that when we use the new rest api from 7.6 then response json has an href which consists of restID for a requested record. We use the same href to request any updates.

    Is this restID stored somewhere in DB? or does this rest ID get generated on runtime during api call?
    I found that even after restarting the server the restid for a record in a table remains the same therefore I am assuming that these restids are stored in DB and the same is sent with the response json.

    Thanks,
    Biplab

    ------------------------------
    Biplab Choudhury
    Maximo Consultant
    Tata Consultancy Services
    Melbourne
    ------------------------------


  • 2.  RE: Maximo Next Gen Json REST API - RESTID

    Posted Wed March 03, 2021 07:21 AM
    The ID is not saved but calculated based on the Primary (or Alternate if defined) key of the root mbo of the object structure.  For Workorder it would be an encoding of wonum and siteid.  Since the primary key values of the MBO never change, the ID value generated should always be the same.

    ------------------------------
    Tom Sarasin
    Maximo Designer
    IBM
    (978) 899-2592
    ------------------------------



  • 3.  RE: Maximo Next Gen Json REST API - RESTID

    Posted Wed March 03, 2021 07:45 AM
    Hi Tom,

    Thanks for the explanation.
    This helps!



    ------------------------------
    Biplab Choudhury
    Maximo Consultant
    Tata Consultancy Services
    Melbourne
    ------------------------------



  • 4.  RE: Maximo Next Gen Json REST API - RESTID

    Posted Wed March 03, 2021 10:14 AM
    Agreed with Tom's answer. Getting into the specifics, I've found that it can be constructed manually using the primary key attributes of the object. The attributes need to be organized alphabetically and separated by a forward slash (/) character. For an Asset, it would be ASSETNUM / SITEID. For a Work Order, it would be SITEID / WONUM. That combination of data is then Base64 encoded and prefixed with an underscore character. Finally, any equals signs (=) are replaced by dashes (-), any plus signs (+) are replaced by underscores (_), and any forward slashes (/) are replaced by tildes (~).

    let keyAttributeString = "BEDFORD/1001";
    let restID = "_" + btoa(keyAttributeString).replace("=","-").replace("+","_").replace("/","~");

    Hope this helps,
    Alex

    ------------------------------
    Alex Walter
    A3J Group
    ------------------------------