Yes that was it! I am able to successfully query a service request by ticket number. Thanks for your help. I am not going to be bringing back all fields, but wanted to see everything at first to see what was coming back.
Original Message:
Sent: Fri March 17, 2023 08:36 AM
From: Steven Shull
Subject: How to query service request by ticketid via rest
As Tom mentioned, you want to read through the documentation. Our REST API has a ton of features and functionality around it.
To answer your specific issue, my guess is that you have a string value in ticketid (IE SR1234) and didn't wrap the value in quotes. Thus you were getting an error like "
BMXAA8744E - The OSLC query was not parsed. Ensure that the query in the HTTP request follows the correct syntax of the OSLC query specification"
Something that may not be obvious to someone new to the API is our new JSON API was built on top of our OSLC API. You will want to use the JSON API instead of the OSLC API implementation which requires adding a query parameter of lean=1. This avoids the namespaces and other complicated topics of OSLC.
My example here would be something like:
https://mysite.com/maximo/api/os/mxapisr?lean=1&oslc.select=*&oslc.where=ticketid="SS1329"
Also be careful to not use oslc.select=* in actual integrations. It's OK to use for initial testing of queries but applications don't need all the data available on the object structure. In addition to increasing the size of the payload, this causes additional queries to execute, additional java class logic to evaluate, etc. which slows down the request. In MXAPISR for example, we're going to query for WORKLOG, DOCLINKS, TICKETSPEC, SITE, etc. even if you aren't using that data. You want to build the oslc.select with just the attributes you need like oslc.select=ticketid,description,siteid,status
------------------------------
Steven Shull
Original Message:
Sent: Thu March 16, 2023 03:01 PM
From: Christopher Stewart
Subject: How to query service request by ticketid via rest
New to maximo and wondering how to query a service request by the ticket number? I can query by the ticketuid like this:
https:/site.com/maximo/api/os/MXAPISR?oslc.select=*&oslc.where=ticketuid=2314
When I try to query by ticketid I get errors. Does anyone have the http call for querying on ticketid?
------------------------------
Christopher Stewart
------------------------------
#MaximoIntegrationandScripting
#AssetandFacilitiesManagement