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

invalid Request class member ExportApprovedOnly for ExportProjectTranslation #48

Closed
penspanic opened this issue Mar 17, 2022 · 5 comments
Labels
question Further information is requested

Comments

@penspanic
Copy link

I tried to call API ExportProjectTranslation with below code, but got response error.

            DownloadLink exportedLink = await apiClient.Translations.ExportProjectTranslation("ProjectId",
                new ExportProjectTranslationRequest()
                {
                    TargetLanguageId = "en",
                    ExportApprovedOnly = true, // seems invalid paramter for current Crowdin API Service.
                });

and error detail:

Url https://@@@@.crowdin.com/api/v2/projects/4/translations/exports
Method POST
Status Error
Message Bad Request
Authorization Type Personal Access Token

Request details | { "targetLanguageId": "en", "exportApprovedOnly": true }
Errors | { "errors": [ { "error": { "key": "exportApprovedOnly", "errors": [ { "code": "notFound", "message": "Field 'exportApprovedOnly' Not Found" } ] } } ] }

Please check this issue.

@zozulka
Copy link

zozulka commented Mar 17, 2022

Hi there,

Could you please tell us which error did you get to investigate this issue?

@andrii-bodnar
Copy link
Member

Hi @penspanic!

The ExportApprovedOnly parameter is available only for crowdin.com. For Crowdin Enterprise the ExportWithMinApprovalsCount (minimum count of approvals for translation to be exported) request parameter should be used.

Export Project Translation - enterprise docs

@andrii-bodnar andrii-bodnar added the question Further information is requested label Mar 17, 2022
@penspanic
Copy link
Author

@andrii-bodnar Thanks for reply.

So, when using Crowdin Enterprise,
Is this crowdin-api-client-dotnet sdk might not suitable for some APIs?

I used CrowdinApiClient.SendPostRequest method and get success result, but want to know that any suitable sdk for Crowdin Enterprise is exists.

@andrii-bodnar
Copy link
Member

@penspanic, crowdin-api-client-dotnet is suitable for both Crowdin APIs and Crowdin Enterprise APIs.

In your case, the code should look something like that:

DownloadLink exportedLink = await apiClient.Translations.ExportProjectTranslation("ProjectId",
    new ExportProjectTranslationRequest()
    {
        TargetLanguageId = "en",
        ExportWithMinApprovalsCount = 1,
    });

@penspanic
Copy link
Author

@andrii-bodnar Oh, I got it. thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants