What is your Revit ID? Element Id or Unique Id?
If it's element id, you can find it in the object name in Forge Viewer, or decode it from the external id like this thread: Missing revit ID in instance elements
Note. For the worksharing Revit models, the element id decoded from
the external id is different from its actual value, since the final
element id is determined after the element is synced to the central
model.
For Revit unique id, you can find it in the external id of the object properties in Forge viewer.
So, you can find the similarities in the response of GET {urn}/metadata/{modelGuid}/properties, but it's a flattened data structure. To get the relationship of instance, type, and category, we need to iterate the object tree from the GET {urn}/metadata/{modelGuid}.
Note. SVF2 model will remove element id from the object name. If you don't
see that, that means your model was translated to SVF2. You can use
the request header x-ads-derivative-format: fallback
to get SVF
properties if the model is stored on BIM360 Docs/Autodesk Docs, or if
you request SVF translation for the same model.
Here is another explanation of the difference between Revit Element Id and unique id: https://stackoverflow.com/a/48720285/7745569
Lastly, here is the JavaScript code snippet of extracting element id from the object name using regex:
const name = 'Floors [123456]'
const elementIdRegx = new RegExp(/\[(.*?)\]/gm);
const result = elementIdRegx.exec( name );
const elementId = result[1]; //!<<< 123456