Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we get a working HelloWorld? Poor developer experience lacking Getting Started guide and Documentation / SDK out of sync #507

Closed
tdhatcher opened this issue May 7, 2022 · 6 comments
Assignees
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@tdhatcher
Copy link

tdhatcher commented May 7, 2022

@DomDom3333 The OAuth is useful in case if you make some apps available for 3rd parties. Or if you don't want to share your secret id and key via code. See more information in Alpaca documentation. In .NET SDK you just replace the SecretKey class with the OAuthKey class and all other code will be the same.

Originally posted by @OlegRa in #436 (comment)

Unpleasant developer experience is all I can say. The marketing website of Alpaca is great and sounds like it can do so much.... but jeesh I still haven't been able to do anything very useful yet after nearly 5 hours and a lot of:

401 "request is not authorized"
403 "forbidden"
404 "endpoint not found."

I've lost several hours making no progress on something so trivial such as authenticating.

I too spent a few hours wondering what the heck I was doing incorrectly with my C#/.NET client auth configuration. In the Alpaca UI Dashboard there needs to be a menu item in the UI for "API Access" so it stands out next to the OAuth Apps menu item!

After exploring the Alpaca UI Dashboard I had just concluded "well OAuth with client_credentials must be how it connects" and mistakenly using the ClientId and ClientSecret.

That is until I found myself googling and then on some random documentation page several layers deep in the Alpaca site that states on the overview page is where you find the API key Id and Secret (https://alpaca.markets/learn/connect-to-alpaca-api)

image

Okay so I finally have the correct credentials and now I should be sailing.... well no.

I decided to avoid trying this through C#/.NET and go direct with postman after forking the workspace (ie. https://www.postman.com/alpacamarkets)

Set my environment correctly and try using the broker api clock --- and 403 forbidden. Still nothing works.

Next I try the trader api clock -- and instead of 403 I get a 401 (an improvement but I expected a success 200!)

image

Next I try the market data api and hit the endpoint /v2/stocks/VOO/quotes .... 200 to my amazement.
image

Okay now I'm ready to go back to C#/.NET and I update my aspnet core application... I setup up with IAlpacaTradingClient and IAlpacaDataClient.

image

And still, I'm getting 401 with the trading client just to hit the /v2/clock endpoint. I can fetch the quote with 200. I explore a bit and see there is a method for IAlpacaDataClient.ListExchangesAsync() and wham "endpoint not found". Why is the SDK accessing an endpoint that doesn't exist?

image

What is going on here? Why does very little work? Makes it pretty difficult to view this as a reliable platform with this initial experience. There needs to be some focus on getting developers off the ground and running with some documentation improvements. A sandbox should not have limitations if that is what is behind all this 403 nonsense.

Based on the marketing website I thought this would be a well polished experience... far from it. I decided to try this out before Interactive Brokers after narrowing it down to these 2 platforms to explore for programmatic transactions and brokerage services. Alpaca seemed better at the time.

@tdhatcher
Copy link
Author

I left out I was using version 5.3.1 of the nuget packages for both Alpaca.Markets and Alpaca.Markets.Extensions

I did try bumping the package references to preview 6.0.3-rc1 and then couldn't get even as far as I did with 5.3.1 due to httpclient issues as part of dependency injection configuration which are details encapsulated by the Alpaca.Markets.Extensions

https://www.nuget.org/packages/Alpaca.Markets/

@OlegRa
Copy link
Collaborator

OlegRa commented May 8, 2022

@tdhatcher Thanks a lot for your detailed feedback. I'll try to summarize your problems and answer some questions:

  1. It's not clear how to obtain authorization data on the Alpaca site. I think it's a general Alpaca documentation problem and it would be better if you'll report it as a separate issue on this or this repo. From my side, I'll try to write a more detailed explanation (with code examples) on this Wiki page and add a link to this page into the README.md file.
  2. It's not clear which SecretKey implementation should be used for both types of authentication. If you have a better idea of how to design it from the .NET/C# perspective I'll be glad to hear your proposal. Again, I'll try to make the related Wiki page more useful and explain it in more detail.
  3. Looks like you've incorrectly used the Broker API Postman collection for your testing (Set my environment correctly and try using the Broker API clock --- and 403 forbidden. Still nothing works.) instead of Market v2 Data API collection. Again, this problem has no relation to the SDK itself and should be reported as a documentation issue (IMO).
  4. The ListExchangesAsync problem. I'll check it right now and if the URL preparation logic was broken I fix it and prepare an updated version for all affected packages.
  5. The problem with the latest 6.0.3-rc1 version. Please, open the separate issue and provide more details about your problem. It's not clear from your last comment what exactly goes wrong and why all works fine for the 5.3.1 because I don't see too many differences in the NuGet dependencies graph between these two versions.

Please, add any issues that I've missed from your long posts to this list. But please don't mix Alpaca documentation issues and SDK issues. And if you have ideas on how to make good HowTo I can assign you an issue #23 - I'm not a technical writer so any help in this area is very appreciated!

@OlegRa OlegRa self-assigned this May 8, 2022
@OlegRa OlegRa added help wanted Extra attention is needed question Further information is requested labels May 8, 2022
@OlegRa
Copy link
Collaborator

OlegRa commented May 8, 2022

@tdhatcher Update - I've created separate issue #508 about the ListExchangesAsync (and 2 other metadata-related methods) problems.

@tdhatcher
Copy link
Author

tdhatcher commented May 8, 2022

@OlegRa thanks for the response. I suspect a few of the issues I ran into related to 403 status aren't specific to the .NET/C# SDK but it's hard to diagnose at first whether that is the case. I was reading some documentation earlier today and found another buried nuget of helpful information.

https://alpaca.markets/learn/fetch-historical-data/
image

I'd say in general the Alpaca developer onboarding experience needs a bit of work. As a newcomer to the platform you are kind of left with no clear learning path so where to start isn't exactly clear and what prerequisites are required. Or what capabilities your account has.

Just another example how a newcomer needs to read different disjointed articles to try and piece the puzzle together. Half way through the article you encounter critical prerequisite action.

https://alpaca.markets/learn/generating-alpaca-api-client-in-3-easy-steps-with-the-openapi-generator/
image

I will try to keep fiddling with it and trying to work through issues I encounter and try to document. And will contribute whatever I can if I can get things working.

But seems like there are a few areas where issues arise: Account capabilities, API Documentation, Postman workspace, and .NET/C# SDK

@tdhatcher
Copy link
Author

The kind of experience looks consistent for other newcomers. Here's a post in the forum "Forbidden Here. Forbidden There."

https://forum.alpaca.markets/t/forbidden-here-forbidden-there/7255/3

@OlegRa
Copy link
Collaborator

OlegRa commented May 9, 2022

@tdhatcher Could you please provide more information about issue number 5 in my list (the problem with the latest 6.0.3-rc1 version)?

@OlegRa OlegRa closed this as completed May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants