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

Usage API #38

Closed
detresed opened this issue Oct 4, 2023 · 4 comments
Closed

Usage API #38

detresed opened this issue Oct 4, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@detresed
Copy link

detresed commented Oct 4, 2023

Describe the bug
The JSON (the props) of the useage API have been changed and running _translator.GetUsageAsync() only returns
{"Character":null,"Document":null,"TeamDocument":null,"AnyLimitReached":false}

To Reproduce
Steps to reproduce the behavior:

  1. _translator.GetUsageAsync()
  2. check result, will be null

Expected behavior
I expect Character to be correctly filled with a value.

Additional context
Currently SDK uses characterCount new API name is character_count

@JanEbbing
Copy link
Member

JanEbbing commented Oct 4, 2023

Edit: Sorry your comment about the field name having changed threw me off a bit. We are investigating, take the original answer with a grain of salt.

Original:
Hi, sorry I can't reproduce this. The return value has always been in lower snake case, which we use to parse the JSON here (and have been for 2yrs). Could you provide more info how you're running your code? (deepl-dotnet version, Dotnet version etc).

With v1.7.1 of the library, the following code:


var translator = new Translator(AUTH_KEY);
var usage = await translator.GetUsageAsync();                
Console.WriteLine(usage.ToString());

Does not print nulls for me, but correctly returns the usage.

@detresed
Copy link
Author

detresed commented Oct 4, 2023

I have found the issue on another place. The API has stopped sending the character_limit and only send character_count, resulting in Character being nulled.

@daniel-jones-deepl daniel-jones-deepl added bug Something isn't working and removed needs-verification labels Oct 11, 2023
@daniel-jones-deepl
Copy link
Member

I'd like to give an update: we've reproduced the problem and pinpointed the issue; we're working on a fix.

@daniel-jones-deepl
Copy link
Member

This issue should be fixed as of Oct 13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants