Idea ID: 2834168

Set UserOptions fields via REST

Status : Accepted
10 months ago

It has to be possible to set fields of UserOptions via REST.

At the moment it is possible to use a REST call to open a request for an offering without filling in the UserOptions, even if they are marked as mandatory.
In my opinion this is a major failure.
However, in my opinion it is not enough to prevent this, but it should also be possible to order an offering via REST, just like via the portal. This includes the specification of UserOptions.

Tags:

Labels:

SMAX
  • Thanks for your help, your solution works
    But of course it would be even better if this would be officially supported.

  • You should be able to create a Request by API and pass User Option details embedded in the JSON Payload.

    This is not officially documented and hence the Idea posted here should be considered by Product Management for official support. Yet with this disclaimer, you can try the following:  

     

    1) Invoke the createRequest API as in https://<YOUR_SMAX_HOS>/rest/<TENANT_ID>/ess/request/createRequest

    2) The JSON Body should be as in the following example:

    {

             "entities": [{

                       "entity_type": "Request",

                       "properties": {

                                "Description": "Test",

                                "DisplayLabel": "Test Title",

                                "RequestedForPerson": "<Some User ID>",

                                "RequestsOffering": "<Your Offering ID>",

                                "RequestedByPerson": "<Some User ID>",

                                "ImpactScope":"Enterprise",

                                "Urgency":"SlightDisruption",

                                "UserOptions": "{\"complexTypeProperties\":[{\"properties\":{\"OPTION1_c\":\"OPTION_1_VALUE\",\"OPTION2_c\":\"OPTION2_VALUE\", ... }}"

                       }

             }],

             "operation": "CREATE"

    }

     

    Again - the above has been used for some special cases, and you may try it. But the feature described here should be added to the official supported documentation for supported adoption.