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

KeyStatsStatAsync throws error #8

Closed
MikeCoderr opened this issue Apr 8, 2020 · 3 comments
Closed

KeyStatsStatAsync throws error #8

MikeCoderr opened this issue Apr 8, 2020 · 3 comments
Labels
bug Either the bug, or the bug fix

Comments

@MikeCoderr
Copy link

Hi,

When I execute below code, I get an error like this (sure enough my Tokens are in there):
Child “token” fails beause [“token” must be a string

using (var iexCloudClient = new IEXCloudClient("pk_", "sk_", signRequest: true, useSandBox: false))
            {
                var response = await iexCloudClient.Stock.KeyStatsStatAsync("AAPL", "marketCap");
                if (response.ErrorMessage != null)
                {
                    Console.WriteLine(response.ErrorMessage);
                }
                else
                {
                    Console.WriteLine(response.Data.marketcap);
                }
            }

Any ideas what could be the issue?

@vslee vslee closed this as completed in c43f0ff Apr 9, 2020
@vslee
Copy link
Owner

vslee commented Apr 9, 2020

Okay, should be fixed now. FYI, the stat is marketcap all lowercase. If you want to try out the update, you'll have to get the latest prerelease from GH Packages

@vslee vslee added the bug Either the bug, or the bug fix label Apr 9, 2020
@MikeCoderr
Copy link
Author

Thanks.

Same issue as above happens here:
var response = await iexCloudClient.Stock.QuoteFieldAsync("AAPL", "marketcap");

maybe you can fix that as well

vslee added a commit that referenced this issue Apr 9, 2020
- removed duplicate pk injection
- added test for issue #8 (third comment)
- fixes #8 (third comment)
@vslee
Copy link
Owner

vslee commented Apr 9, 2020

Fixed. Note that for QuoteFieldAsync(), marketCap has a capital C

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Either the bug, or the bug fix
Projects
None yet
Development

No branches or pull requests

2 participants