Exportar Relatório de Melhores Membros

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.

Crowdin API v2
Gerar relatório dos Top Membros, para saber quem contribuiu mais para a tradução do teu projeto durante o período especificado.

Pedido

Note: Use the combination of project identifier, username, and account key to pass to this endpoint.

POST https://api.crowdin.com/api/project/{project-identifier}/reports/top-members/export?login={username}&account-key={account-key}

Parâmetros

Nome Valor Descrição
unit optional string Defines the report unit. Acceptable values are: 'strings', 'words' (by default), 'chars', 'chars_with_spaces'.
idioma opcional string The language for which the report should be generated. For this use Сrowdin language codes.
date_from optional data Strings added from. Use the following ISO 8601 format: YYYY-MM-DD ±hh:mm
date_to optional data Strings added to. Use the following ISO 8601 format: YYYY-MM-DD ±hh:mm
format optional string Defines the export file format. Acceptable values are 'csv' and 'xlsx' (by default).
json opcional string May contain no value. Define que a resposta deve estar no formato JSON.
jsonp opcional string Nome da função de retorno de chamada. Define que a resposta deve estar no formato JSONP.
Variáveis
project-identifier string Identificador do projeto.
login string O teu nome de utilizador no Crowdin.
account-key string A tua chave API de conta.

Resposta

If the method is successful it responds with an XML structure, as it is shown below.
<?xml version="1.0" encoding="UTF-8"?>
<success>
  <hash>cd798eb822227162375675b9a4e8a95a1</hash>
</success>
Exemplo de resposta mal-sucedida:
<?xml version="1.0" encoding="UTF-8"?>
<error>
  <code>3</code>
  <message>A chave API não é válida</message>
</error>

Exemplos

curl \
  https://api.crowdin.com/api/project/{project-identifier}/reports/top-members/export?login={username}&account-key={account-key}
curl \
  -F "unit=chars" \
  -F "format=csv" \
  -F "language=uk" \
  https://api.crowdin.com/api/project/{project-identifier}/reports/top-members/export?login={username}&account-key={account-key}
<?php
$request_url = 'https://api.crowdin.com/api/project/{project-identifier}/reports/top-members/export?mode=words&login={username}&account-key={account-key}&language=uk';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $request_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);
curl_close($ch);

echo $result;

Este artigo foi útil?