I am using C# and httpClient to try and access the accounts endpoint. I keep getting a Status = WaitingForActivation. Code is shown below.
private static string API_KEY = "copiedfromaccount";
private static string API_SECRET = "copiedfromaccount";
private static string baseUrl = "https://paper-api.alpaca.markets/v2/account/";
HttpClient client = new HttpClient();
client.DefaultRequestHeaders.Add("APCA-API-KEY-ID", API_KEY);
client.DefaultRequestHeaders.Add("APCA-API-SECRET-KEY", API_SECRET);
var response = client.GetAsync(baseUrl);
@physics90 I can maybe help debug. Can you try fetching the account info using something other than C#? Perhaps Postman? Then paste the entire response here. That will point to either an account issue or a C# SDK issue.
1 Like
Sure thing. I have to step away for a cpl hours. When I get back home I’ll try postman. Thank you for your help.
So I used the Try It on the API Reference page and it appears to be working with that. So maybe it’s my code somehow. I’ll try and mimic what the alpaca page did. Interestingly, they used RestSharp to send the request versus just httpclient.
@physics90 Good that you narrowed it to the SDK or your code. Post back if you have any other issues.
I also tried postman and it works. So there’s some issue with my code. Thank you for the nudge