Übersetzungskosten-Bericht exportieren

Generate Translation Costs report to calculate the real translation cost and know how much your translators and proofreaders should be paid.

Anfrage

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/translation-costs/export?login={username}&account-key={account-key}

Parameter

Name Wert Beschreibung
unit optional String Defines the report unit. Acceptable values are: 'strings', 'words' (by default), 'chars', 'chars_with_spaces'.
mode optional String Defines the report mode. Acceptable values are: 'simple' (by default), 'fuzzy'.
date_from optional date Strings added from. Use the following ISO 8601 format: YYYY-MM-DD±hh:mm
date_to optional date Strings added to. Use the following ISO 8601 format: YYYY-MM-DD±hh:mm
regular_rates optional Array Defines the regular rates for the specified categories.
Possible categories for a report in the simple mode are: 'default', 'tm', 'approval'.
Possible categories for a report in the fuzzy mode are: 'aproval', 'translation', 'perfect', 'matched' and three customized ranges between 60% and 100% (for example: 99-90).
individual_rates optional Array Defines individual rates for the specified languages in the specified categories. Each item must contain the language and the rate parameters. The possible rate categories are the same as for the 'regular_rates' parameter.
currency optional String Defines the currency for which the whole report is generated. Zulässige Werte sind: „$” (Standardwert), „€”, „¥”, „£”, „A$”, „C$”, „Fr”, „CN¥”, „kr”, „NZ$”, „MX$”, „S$”, „HK$”, „kr”, „₩”, „₺”, „₽”, „₹”, „R$” und „R”.
format optional String Defines the export file format. Acceptable values are 'csv' and 'xlsx' (by default).
role_based_costs optional Bool Defines whether the costs should be calculated based on contributions or on the role in the project. Possible values are 0 or 1. Der Standardwert ist 0.

0 – costs will be calculated for all the translations and approvals made by each project member, regardless of the role in the project;
1 – costs will be calculated based on the project member's role. Which means that all the translations and approvals made will be displayed, but the costs for translations are calculated only for translators, costs for approvals – only for proofreaders.
Note: contributions of the project members who are currently blocked, or with no access to the language will also be listed, but not included in the cost.
group_by optional String Group data by 'user' (default) or by 'language'.
json optional String Könnten keinen Wert enthalten. Defines that the response should be in a JSON format.
jsonp optional String Name der Rückruf Funktion. Defines that the response should be in a JSONP format.
Variablen
project-identifier String Projekt-ID.
login String Ihr Nutzername auf Crowdin.
account-key String Ihr Konto API-Schlüssel.

Antwort

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>x27bae8588c6904fe33b494fc3b3b8d40</hash>
</success>
Unsuccessful response sample:
<?xml version="1.0" encoding="UTF-8"?>
<error>
  <code>3</code>
  <message>API key is not valid</message>
</error>

Beispiele

curl \
  -F "unit=chars" \
  -F "mode=simple" \
  -F "format=csv" \
  -F "regular_rates[default]=1.05" \
  -F "regular_rates[tm]=1.00" \
  -F "regular_rates[approval]=2.00" \
  -F "individual_rates[0][languages][]=uk" \
  -F "individual_rates[0][languages][]=ca" \
  -F "individual_rates[0][languages][]=af" \
  -F "individual_rates[0][languages][]=fr" \
  -F "individual_rates[0][rates][default]=1.40" \
  -F "individual_rates[0][rates][tm]=1.10" \
  -F "individual_rates[0][rates][approval]=2.00" \
  -F "individual_rates[1][languages][]=de" \
  -F "individual_rates[1][rates][default]=1.55" \
  -F "individual_rates[1][rates][tm]=1.20" \
  -F "individual_rates[1][rates][approval]=2.10" \
  https://api.crowdin.com/api/project/{project-identifier}/reports/translation-costs/export?login={username}&account-key={account-key}
curl \
  -F "unit=words" \
  -F "mode=fuzzy" \
  -F "format=xlsx" \
  -F "regular_rates[translation]=2.05" \
  -F "regular_rates[perfect]=1.00" \
  -F "regular_rates[matched]=1.00" \
  -F "regular_rates[99-95]=1.03" \
  -F "regular_rates[94-90]=1.05" \
  -F "regular_rates[89-80]=1.20" \
  -F "regular_rates[approval]=3.00" \
  https://api.crowdin.com/api/project/{project-identifier}/reports/translation-costs/export?login={username}&account-key={account-key}
<?php
$request_url = 'https://api.crowdin.com/api/project/{project-identifier}/reports/translation-costs/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;

War dieser Artikel hilfreich?