Trouble with /order/placeoco

I am having trouble using the OCO endpoint in the API. I’m not sure what I’m doing wrong, any help would be appreciated! For context, I’m using python with the requests library and sending a post request.
I keep getting this error message:
<Response [400]>
Invalid JSON: expected ‘{’, offset: 0x00000075

Here is the code for my header, and request data.

    headers = {
        'Authorization': f'Bearer ${token}', 
        'Accept': 'application/json'
    }

    other = {
        "action": "Sell",
        "orderType": "Limit",
        "price": 3635
    }

    oco = {
            "accountSpec": MY_USER_NAME,
            "accountId": MY_ACCOUNT_ID,
            "action": "Sell",
            "symbol": "MESZ2",
            "orderQty": 1,
            "orderType": "TrailingStop",
            "price": 3590,
            "stopPrice": 3590,
            "isAutomated": "true",
            "other": other
        }

res = requests.post(url=url, data=oco, headers=headers)

Let me know if anyone is having a similar problem!
Thanks!

@Alexander any ideas?

are you able to solve this? This is something to do with python dictionary

I was not able to solve this

I did try and had the same issue. I use simple Buy and Sell. I could not get it to work OpenOrderstrategy or OCO using python.

other = {
“action”: “Sell”,
“orderType”: “Limit”,
“price”: 3635
}

oco = {
“accountSpec”: “yyyy”,
“accountId”: xxxx,
“action”: “Sell”,
“symbol”: “MESZ2”,
“orderQty”: 1,
“orderType”: “TrailingStop”,
“price”: 3590,
“stopPrice”: 3595,
“isAutomated”: “true”,
“other”: str(other)
}
Below is the response:

https://demo.tradovateapi.com/v1/order/placeoco
Open Long Invalid JSON: expected ‘{’, offset: 0x00000075
https://demo.tradovateapi.com/v1/orderstrategy/startorderstrategy

<Response [400]>

I did try changing json.loads(other), str(others) but none worked.

We need Mr. Alexander’s help and he is a master of API

That is the same error I had. I also tried json.loads and many other things and nothing worked. I gave up because Tradovate wasn’t helping me and it seems to be a problem on their end. No excuse for bad documentation with a paid API. I agree Alexander is the only one who can help us now…

You should try to use json.dumps({ "dictionary": "items" }). I’m pretty sure that’s all you need to encode the python dictionary to JSON. However, json.loads parses a JSON string into a py dictionary.

Noticed this issue still occurs. Did anyone ever solve it?