PrestaShop / TopTranslators

Top translators tribute page
https://translators.prestashop-project.org/
0 stars 3 forks source link

Crowdin API v1 is deprecated #69

Open davidglezz opened 9 months ago

davidglezz commented 9 months ago

This project uses Crowdin API version 1 which is deprecated:

[!WARNING]
Please consider that API 2.0 is now the preferred version to be used. The old API will remain fully functional until the end of 2021.

Luckily the v1 API still works despite what was announced.

We should migrate and use the v2 API

Crowdin API v1: https://developer.crowdin.com/assets/api/api_v1_docs_crowdin.pdf Crowdin API v2: https://developer.crowdin.com/api/v2/

matks commented 9 months ago

Crowdin API v1 is supposed to shutdown for good in November.

I say "suppose" because as you mentioned it was supposed to be stopped two years ago 😄

matks commented 8 months ago

I just checked

It seems we'll have to use a POST request to generate a Report file https://developer.crowdin.com/api/v2/#tag/Reports then download it. This is how we'll get the top members of crowdin.

In order to migrate the usage of TopTranslators from Crowdin API v1 to Crowdin API v2, it will probably be needed to modify https://github.com/PrestaShop/TopTranslators/blob/prod/csv_to_json/index.js to accomodate the new data format.

davidglezz commented 7 months ago

Yes! this endpoints could be useful: https://developer.crowdin.com/api/v2/#operation/api.projects.languages.files.progress.getMany https://developer.crowdin.com/api/v2/#operation/api.projects.reports.post

I don't have api-key to play with it.

matks commented 3 months ago

I think API v1 is finally down

curl "https://api.crowdin.com/api/project/prestashop-official/status?key={key}&json" returns

{
    "success": false,
    "error": {
        "code": 1,
        "message": "Requested project doesn't exist or the API key is invalid"
    }
}
matks commented 3 months ago

So fetching the data is failing since 4 days https://github.com/PrestaShop/TopTranslators/actions/runs/8431561717

matks commented 3 months ago

Using https://api.crowdin.com/api/v2/projects/PROJECT-ID/branches/BRANCH-ID/languages/progress can provide the percentage of completion for each language

However https://developer.crowdin.com/api/v2/#operation/api.projects.reports.post only provides the top translators for a given language, not all languages considered

matks commented 3 months ago

I tried using https://api.crowdin.com/api/v2/projects/PROJECT-ID/reports/ anyway but https redirects me to http which redirects me to https which redirects me to http...