Get Order does not work

Tried the get order working, i can get fills, order buy and sells, see code below

request_method = "GET"
#print(order_id)
request_path = "/api/v3/brokerage/orders/historical/"
payload = ""
conn = http.client.HTTPSConnection("api.coinbase.com")
jwt_token = auth(request_method,request_path)
print(jwt_token)
headers = {

‘Content-Type’: ‘application/json’,
‘Authorization’: f’Bearer {jwt_token}’
}
request_path = request_path + order_id
print(request_path)
start_date = str(int(time.time()-(60**2)))
end_date = str(int(time.time()))
conn.request(request_method, request_path, payload, headers)
res = conn.getresponse()
data = res.read()
print(data)
data = json.loads(data)
return data

order_id not shown

Thanks in Advance

Andrew

1 Like

You need to include order id path also when generating JWT. Also use Preformatted text option for code!

1 Like

thank you missed that

1 Like

I tried adding the order_id see below and it does not work

/api/v3/brokerage/orders/historical/a3ed9f7f-7ac7-4be6-9b33-1a7190b402bea3ed9f7f-7ac7-4be6-9b33-1a7190b402be
b’Unauthorized\n’

i can get a full filled order using the above order id

There are not enough info to help you. Unauthorized errors almost always if not always are user errors. So carefully read documentation and review your code.

Or better try to use their Python SDK: