I have found a number of posts, but none seem to help…
I have tried php, curl and javascript. I can do any GET, but not a single post.
Does anyone have an example of curl or javascript actually working - including the authorization?
here is the latest go around using javascript
FYI - the error is always (on post) “ERR_ABORTED 401 (Unauthorized)”
var raw = JSON.stringify({
“client_order_id”: “6556d745-7c3a-4a1e-8f41-623b51beb269”,
“product_id”: “BTC-USD”,
“side”: “BUY”,
“order_configuration”: {
“limit_limit_gtc”: {
“base_size”: “0.01”,
“limit_price”: “15000.0”,
“post_only”: false
}
}
} );var myHeaders = new Headers();
myHeaders.append(“Content-Type”, “application/json”);
myHeaders.append(“CB-ACCESS-KEY”, “XXXXXX”);
myHeaders.append(“CB-ACCESS-SIGN”, “04e63ecba68bd748b19a5a18c79847bdeacXXXXXXXXXXX”);
myHeaders.append(“CB-ACCESS-TIMESTAMP”, “1713147220”);var requestOptions = {
method: ‘POST’,
mode: “no-cors”,
headers: myHeaders,
body: raw,
redirect: ‘follow’
};
fetch(“https://api.coinbase.com/api/v3/brokerage/orders”, requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log(‘error’, error));
I have the following permissions:
wallet:accounts:create
wallet:accounts:delete
wallet:accounts:read
wallet:accounts:update
wallet:addresses:create
wallet:addresses:read
wallet:buys:create
wallet:buys:read
wallet:checkouts:create
wallet:checkouts:read
wallet:contacts:read
wallet:deposits:create
wallet:deposits:read
wallet:notifications:read
wallet:orders:create
wallet:orders:read
wallet:orders:refund
wallet:payment-methods:delete
wallet:payment-methods:limits
wallet:payment-methods:read
wallet:sells:create
wallet:sells:read
wallet:supported-assets:read
wallet:trades:create
wallet:trades:read
wallet:transactions:read
wallet:transactions:request
wallet:transactions:send
wallet:transactions:transfer
wallet:user:email
wallet:user:read
wallet:user:update
wallet:withdrawals:create
wallet:withdrawals:read