Maximo Open Forum

 View Only
  • 1.  Is it possible to create a Value for a created Domain via REST API

    Posted 23 hours ago

    In IBM Maximo, I created a Domain with the domainid X_PROJECTCODE. This Domain is stored in the MAXDOMAIN table. Within this Domain, I can create values, which are stored in the ALNDOMAIN table.

    I am working with the Maximo REST API and attempting to create values for the Domain with domainid X_PROJECTCODE, but the request fails.

    I am able to create Domains but not values for Domains.

    I used the following request to create a Domain with domainid = "TESTDOMAIN"

    POST https://url/maximo/api/os/mxapidomain?lean=1
    (API key authentication is used. Object Structure MXAPIDOMAIN was used. This request creates a record in the MAXDOMAIN table.)

    Request body is raw and JSON:

    {
        "domainid": "TESTDOMAIN",
        "description": "Test Domain Creation",
        "domaintype": "ALN",
        "maxtype": "ALN",
        "length": "30"
    }

    This request worked as expected, a Domain was created.

    Next, I attempted to create a value for the existing Domain with domainid X_PROJECTCODE.

    POST https://url/maximo/api/os/mxapialndomain?lean=1
    (API key authentication is used. Object Structure MXAPIALNDOMAIN was used. This request should create a record in the ALNDOMAIN table.)

    Request body is raw and JSON:

    {
        "domainid": "X_PROJECTCODE",
        "value": "99999-9999-9999-991",
        "description": "Test X_PROJECTCODE Value Creation",
        "siteid": "50002",
        "orgid": "EAGLE"
    }

    The attributes provided match the columns in the ALNDOMAIN table; however, the request fails with the following error:

    {
        "Error": {
            "extendedError": {
                "moreInfo": {
                    "href": "https://url/maximo/api/error/messages/BMXAA4214E"
                }
            },
            "reasonCode": "BMXAA4214E",
            "message": "BMXAA4214E - An unknown error has occurred. Please contact your system administrator for assistance. Gather the logs from the <HOME> directory and determine where and why the error occurred.\n\tnull",
            "statusCode": "400"
        }
    }

    what am I doing wrong here? Is it even possible to create a Value for a specific Domain using Object Structure MXAPIALNDOMAIN? attached are photos of my Postman Environment for a clearer picture.


    #Administration
    #Architecture
    #Customizations
    #EverythingMaximo
    #Infrastructure
    #Integrations
    #Security

    ------------------------------
    Julio Roca
    BCBS
    ------------------------------


  • 2.  RE: Is it possible to create a Value for a created Domain via REST API

    Posted 13 hours ago

    Domains require the parent (owner) MBO to be MAXDOMAIN when you are adding values. IBM honestly shouldn't have created the MXAPIALNDOMAIN object structure or at least set it as query only for this reason.

    MXAPIDOMAIN works for creation of the main domain and all the values. You can do this as a single request or an update using x-method-override PATCH & patchtype MERGE headers with the href of your domain. In your JSON object you'll have a JSON array for the values. Something like:


    {
        "domainid": "TESTDOMAIN",
        "description": "Test Domain Creation",
        "domaintype": "ALN",
        "maxtype": "ALN",
        "length": "30",
        "alndomain":[
            {
            "value": "99999-9999-9999-991",
            "description": "Test X_PROJECTCODE Value Creation",
            "siteid": "50002",
            "orgid": "EAGLE"
            }
        ]
    }



    ------------------------------
    Steven Shull
    Naviam
    ------------------------------