Hi guys,
Rather than using the “alpacahq/alpaca-trade-api” I’d prefer to use only be using fetch. I have been unsuccessful in getting anything other than “status: 401”, " statusText: Unauthorized" as a response.
So I was wondering how I should format my fetch() request to get a proper response. Here’s a code snippet that I’ve just tried with no luck.
Granted this is a bad example, yes, but I haven’t been able to find any documentation using fetch()
fetch("https://paper-api.alpaca.markets/v2/positions", {
"method": "GET",
"APCA-API-KEY-ID": "mykeyhere",
"APCA-API-SECRET-KEY": "mysecretkeyhere"
})
Should I fetch to something like: “https://paper-api.alpaca.markets/v2/positions?apca-api-key-id=mykey&apca-api-secret-key=mysecretkey”?
How would I correct this issue?