Order (Package Request) API Endpoints

App Broker 2020 R1

The App Broker REST API endpoint to place an order requires an HTTP POST method. The user context supplied in the URL query string is stored in the App Broker database as the requester of the order. Target information is provided in the request body in JSON format. The following is a sample order.

Order (Package Request) API Endpoints

Endpoint Example (Input)

Response Body Example (Output)

URI Example

[POST] http://localhost/esd/api/orders?dn=FLEX&un=JaneDoe&dev=WIN-10X64

{

   "id": 101,

   "name": FLX-101,

   "requests": [

     {

        "dateTime": "2015-08-31T17:20:58.927",

        "guid": "290223d0-ea74-4279-aacf-4355f24b8d72",

        "machineName": "WIN-10X64",

        "orderNo": "101",

        "requestID": "2071",

        "uniqueUserName": "FLEX\\JaneDoe",

        "catalogID": "6",

        "authorizationStatus": "pendingApproval",

        "deploymentStatus": "notApplicable",

        "status": "active",

        "availableActions": [

           "cancel"

        ]

     }

  ]

}

Request Body Example: Without Prior License Reservation

{

   "targets":[

      {

         "uniqueUserName":"FLEX\\JaneDoe",

         "machineName":"WIN-10x64",

         "catalogs":[

            {

               "ID":6

            }

         ]

      }

   ]

}

Request Body Example: With Prior License Reservation

{

   "targets":[

      {

         "uniqueUserName":"FLEX\\JaneDoe",

         "machineName":"WIN-10x64",

         "catalogs":[

            {

               "ID":6,

               "ReservationId":108

            }

         ]

      }

   ]

}

Note:If a license reservation ID is not part of the request body to the Orders API, then App Broker will automatically attempt to reserve a license if applicable.

In the above example, the requester is FLEX\JaneDoe. The requester is requesting an order for FLEX\JaneDoe at machine WIN-10X64 for a catalog item with an ID of 6.

As seen in the JSON string, “targets” accept an array of data; therefore, you can request multiple targets by appending a new target object {…} within the array brackets [].

Also, for each target, you can request multiple catalog items since "catalogs" also accepts an array of data. Each catalog object is in the following format, with multiple objects separated by commas within the array brackets []:

{"ID":#}

The response to this order request is an order data object in JSON format with relative information: requester, target, IDs, active or canceled, deployment status, etc.

The request data model (api/requests/# or nested under api/orders/#) contains an array of actions available for the given request. Expect to see either Cancel, Uninstall, or an empty array.

Getting a Specific Order
Getting a Package Request for a Specific User