Topic
4 replies Latest Post - ‏2012-08-07T18:22:36Z by TomSarasin
StephaneMichel
StephaneMichel
2 Posts
ACCEPTED ANSWER

Pinned topic REST API and

‏2012-02-09T08:25:39Z |
Hello, I'm trying to use the _uw property in a REST query with maximo 7.5
This should allow to specify a SQL WHERE clause to be used as the selection criteria
But I'm not able to have it working. Note that I've noticed that the mxe.rest.whereclause.usepolicy system property was not defined in my system, so I've created it with the "parse" value.
I'm trying first with a simple query like:
http://localhost:9080/maxrest/rest/mbo/WORKORDER?_lid="maxadmin"&_lpwd=maxadmin&_uw="wonum='7300'"

I've tried many syntax variants but unsuccesfully.
Obviously the objective is to use more complex sql query and also to use stored query (e.g. SQL WHERE clause stored with a work schedule in the Scheduler application)

any help would be very much appreciated
Updated on 2012-08-07T18:22:36Z at 2012-08-07T18:22:36Z by TomSarasin
  • TomSarasin
    TomSarasin
    18 Posts
    ACCEPTED ANSWER

    Re: REST API and

    ‏2012-02-09T13:08:43Z  in response to StephaneMichel
    Try removing the double quotes around the query parameters. I was able to do similar
    query where only the wo number was in single quotes.
    http://localhost:9999/maximo/rest/mbo/WORKORDER?_uw="wonum='1022'"
  • TomSarasin
    TomSarasin
    18 Posts
    ACCEPTED ANSWER

    Re: REST API and

    ‏2012-02-09T13:09:45Z  in response to StephaneMichel
    sorry pior example was before removing double quotes:
    http://qawin11.swg.usma.ibm.com:9999/maximo/rest/mbo/WORKORDER?_uw=wonum='1022'
    • SpikeBarefield
      SpikeBarefield
      1 Post
      ACCEPTED ANSWER

      Re: REST API and

      ‏2012-08-06T20:55:33Z  in response to TomSarasin
      We also were not able to get the REST API Query Parameter (_uw) to work.

      We are on maximo 7.5.0.0 and we have also created a System Property (mxe.rest.whereclause.usepolicy) and set its value to "parse". It appears that when we use this configuration, the where clause is ignored.

      1) Do we need a more recent version of Maximo than 7.5.0.0?
      2) Is there something else that needs to be configured?
      3) Do you have any examples you could share that do work?

      The other query functionality of the REST API seesm to work, but not the "_uw".
  • TomSarasin
    TomSarasin
    18 Posts
    ACCEPTED ANSWER

    Re: REST API and

    ‏2012-08-07T18:22:36Z  in response to StephaneMichel
    Try using this
    http://localhost:9080/maxrest/rest/mbo/WORKORDER?_lid=maxadmin&_lpwd=maxadmin&_uw=wonum='7300'

    no need to provide quotes around user/pw but you do need single
    quote around the 7300 in the where clause