Placing a Trade using Requests

What am I doing wrong here? I get the error “{‘ok’: ‘0’, ‘error’: {‘title’: ‘Invalid JSON’, ‘message’: ‘Unable to parse as JSON. Check for dangling commas, uneven brackets, and bad hygiene.’}}”

import requests

BASE_URL = ’https://collective2.com/world/apiv3/submitSignal'

params = {
“apikey”:“XXX”,
“systemid”: “XXX”,
‘signal’ : {
“market” : 1,
“symbol” : “AAPL”,
“typeofsymbol” : “stock”,
“action” : “BTO”,
“limit” : “99.99”,
“duration” : “DAY”,
“quant” : 2,
}
}

response = requests.post(BASE_URL, params=params)
print (response.json())

Vennessa - Trying getting rid of the dangling comma (the , character) after “quant”: 2

Also, not sure which quote style you are really using in your call (maybe the forum software reformatted your original quotes) but do not use “curly” quotes. Keep it consistent and use straight double-quotes that are not curly. Notice that in your example, posted above, ‘signal’ uses single quotes while everything else is double-quoted. Please try to keep the quotes consistent (and non-curly).

Between these two things, I suspect you can solve this. Let me know.

See below. Hopefully it’s formatted correctly now. Still getting the same error

import requests

BASE_URL = "https://collective2.com/world/apiv3/submitSignal"

params = {
    "apikey":"XXX",
    "systemid": "XXX",
    "signal" : {
        "market": 1,
        "symbol": "AAPL",
        "typeofsymbol" : "stock",
        "action": "BTO",
        "limit": "99.99",
        "duration": "DAY",
        "quant": 2
        }
    }

response = requests.post(BASE_URL, params=params)
print (response.json())

Try to use double quotes around ‘signal’
IE “signal”
Not ‘signal’

i just did that and still got the same error

Send an email to help@collective2.com with the entire post including system id, key, and full response