Maximo

Maximo

Come for answers, stay for best practices. All we're missing is you.

 View Only
Expand all | Collapse all

Are OSLC NextGen APIs elements case sensitive and are they still available with MAS 8.x

  • 1.  Are OSLC NextGen APIs elements case sensitive and are they still available with MAS 8.x

    Posted Fri February 16, 2024 08:53 AM

    In the past, I tested successful Service Request creation in Maximo 7.6.x using http://<ServerName>/oslc/os/mxsr URI with case sensitive data (e.g. "reportedBy" : "..."). But i do see lot of examples listing it in lower case ("reportedby" : "...").

    Are field names case sensitive in OSLC APIs ?

    Also are OSLC APIs available in MAS 8.x or they have been removed completely by new set of URIs ...

    Thanks



    ------------------------------
    ajay saxena
    ------------------------------


  • 2.  RE: Are OSLC NextGen APIs elements case sensitive and are they still available with MAS 8.x

    Posted Mon February 19, 2024 01:43 PM

    Hi Ajay,

    Answering your questions:

    1. No, the field names are not case sensitive, so you can use both "reportedBy" and "reportedby". However, I'd recommend to use lower-case following the documentation. You can also consider using "mxapisr" object structure instead as it's meant as a Maximo API.

      See the OpenAPI/Swagger documentation for many examples how to work with service requests and other data - https://developer.ibm.com/apis/catalog/maximo--maximo-manage-rest-api/api/API--maximo--maximo-manage-rest-api#post1144351259
    2. Yes, OSLC API's are still available in MAX 8.x. However, there is a change in authentication process. The header "maxauth" will no longer work - if you try using it, you'll be redirected to the html login page. That's because MAS 8.x uses OIDC identity provider. So instead you should use "apikey" HTTP header where the value should be user API key that can be created via "API keys" application in Manage. At the same time you will need to adjust the URI replacing "oslc" by "api". For example, http://<ServerName>/oslc/os/mxsr need be changed to http://<ServerName>/api/os/mxsr

      Here is a working curl example for completeness:
      curl --location 'https://mas.manage.demo.apps.znapz.net/maximo/api/os/mxapisr?lean=1' \
      --header 'apikey: X' \
      --header 'Content-Type: application/json' \
      --header 'properties: reportedpriority,description,description_longdescription,targetfinish,actualfinish,statusdate,ticketid,status,status_description,reportedby,reportdate,rel.serviceaddress{description,saddresscode,latitudey,longitudex},doclinks{title,format,description}' \
      --data '{
          "assetnum": "A1001",
          "description_longdescription": "<b>Test long description</b><!-- RICH TEXT -->",
          "status": "NEW",
          "reportdate": "2024-02-19T09:20:00+01:00",
          "description": "Test description",
          "reportedby": "ILA"
      }'

      The output looks like this:
      {
          "status_description": "New",
          "serviceaddress": [
              {
                  "saddresscode": "L1001",
                  "latitudey": 50.000,
                  "longitudex": 4.000
              }
          ],
          "description_longdescription": "<b>Test long description</b><!-- RICH TEXT -->",
          "worklog_collectionref": "http://localhost/maximo/oslc/os/mxapisr/_U1IvUzEwMDAwMDc-/uxworklog",
          "site_collectionref": "http://localhost/maximo/oslc/os/mxapisr/_U1IvUzEwMDAwMDc-/assetsite",
          "ticketspec_collectionref": "http://localhost/maximo/oslc/os/mxapisr/_U1IvUzEwMDAwMDc-/ticketspecclass",
          "tktemplate_collectionref": "http://localhost/maximo/oslc/os/mxapisr/_U1IvUzEwMDAwMDc-/tickect_template",
          "reportdate": "2024-02-19T08:23:27+00:00",
          "tkserviceaddress_collectionref": "http://localhost/maximo/oslc/os/mxapisr/_U1IvUzEwMDAwMDc-/serviceaddress",
          "description": "Test description",
          "reportedby": "ILA",
          "classstructure_collectionref": "http://localhost/maximo/oslc/os/mxapisr/_U1IvUzEwMDAwMDc-/classstructure",
          "statusdate": "2024-02-19T08:23:27+00:00",
          "_rowstamp": "[0 0 0 0 0 111 91 -80]",
          "persongroup_collectionref": "http://localhost/maximo/oslc/os/mxapisr/_U1IvUzEwMDAwMDc-/srpersongroup",
          "relatedrecord_collectionref": "http://localhost/maximo/oslc/os/mxapisr/_U1IvUzEwMDAwMDc-/relatedwo",
          "href": "http://localhost/maximo/oslc/os/mxapisr/_U1IvUzEwMDAwMDc-",
          "doclinks": {
              "href": "http://localhost/maximo/oslc/os/mxapisr/_U1IvUzEwMDAwMDc-/doclinks",
              "member": []
          },
          "ticketid": "S1001",
          "status": "NEW"
      }

    I hope that helps!



    ------------------------------
    ---------------
    Ivan Lagunov
    Head of R&D
    ZNAPZ B.V.
    ------------------------------



  • 3.  RE: Are OSLC NextGen APIs elements case sensitive and are they still available with MAS 8.x

    Posted Tue February 20, 2024 01:45 PM

    Thanks Ivan for the detailed response.
    One other thing i notice is ticketId used to be returned as Base64 encoded string and to query SR status you have to pass ticket id as Base64 encoded in Request parameter. Seems like not needed, not sure which version got this change.



    ------------------------------
    ajay saxena
    ------------------------------