0
votes

I know how to do it with Python and Java clients, but I would need to do it with REST client, since suitable language specific clients (Java) lacks features (filtering, api url root setting for testing).

How to do it with REST? I tried with this json file as payload:

{
"packageId": 0,
"prices": [{"id":13981}],
"quantity": 1,
"complexType": "SoftLayer_Container_Product_Order_Network_Subnet",
"endPointVlanId": 1366867}

and then request fails without much hints on what is wrong:

curl -X POST -d @data.json https://user:[email protected]/rest/v3.1/SoftLayer_Product_Order/placeOrder 

{"error":"An internal system error has occurred.","code":"SoftLayer_Exception_InternalError"}
1

1 Answers

1
votes

see https://sldn.softlayer.com/es/blog/bpotter/more-softlayer-rest-api-examples using rest the payload should be inside a porperty called "parameters" so ti should be

{
    "parameters": [

        {
            "packageId": 0,
            "prices": [{
                "id": 13981
            }],
            "quantity": 1,
            "complexType": "SoftLayer_Container_Product_Order_Network_Subnet",
            "endPointVlanId": 1366867
        }
    ]
}