IBM Maximo: Get a list of Object Structures using REST API
Getting the list of Object Structures
Request
# python import requests url = "https://mx.com/maximo/oslc/os/MXINTOBJECT" querystring = { "lean":"1", "oslc.select":"intobjectname,description,rel.maxintobjdetail{objectname,hierarchypath}", "oslc.pageSize":"1001", "oslc.where":"usewith='INTEGRATION'"} headers = { 'maxauth': "<CHANGE_HERE>", 'Content-Type': "application/json", 'Accept': "application/json" } response = requests.request("GET", url, headers=headers, params=querystring) print(response.text)
- Traz apenas parte dos atributos: oslc.select=intobjectname,description,rel.maxintobjdetail{objectname,hierarchypath}
- Define a seleção com oslc.where=usewith="INTEGRATION"
Response
{ "member": [ { "_rowstamp": "1401947183", "maxintobjdetail_collectionref": "https://mx.com/maximo/oslc/os/mxintobject/_TVhJTlZFTlRPUlk-/maxintobjdetail", "description": "Definição de Blablabla", "maxintobjapp_collectionref": "https://mx.com/maximo/oslc/os/mxintobject/_TVhJTlZFTlRPUlk-/maxintobjapp", "maxintobjdetail": [ { "hierarchypath": "WORKORDER", "objectname": "WORKORDER" }, { "hierarchypath": "WORKORDER/WOACTIVITY", "objectname": "WOACTIVITY" }, ], "href": "https://mx.com/maximo/oslc/os/mxintobject/_TVhJTlZFTlRPUlk-", "intobjectname": "MXWOBLABLA" }, ... ], "href": "https://mx.com/maximo/oslc/os/MXINTOBJECT", "responseInfo": { "href": "https://mx....", "pagenum": 1 } }