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
------------------------------
Original Message:
Sent: Wed March 03, 2021 07:21 AM
From: Tom Sarasin
Subject: Maximo Next Gen Json REST API - RESTID
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
Original Message:
Sent: Tue March 02, 2021 11:51 PM
From: Biplab Choudhury
Subject: Maximo Next Gen Json REST API - RESTID
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
------------------------------
#Maximo
#MaximoIntegrationandScripting
#AssetandFacilitiesManagement