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.
Название | Значение | Описание |
---|---|---|
unit optional | строка | Defines the report unit. Acceptable values are: 'strings', 'words' (by default), 'chars', 'chars_with_spaces'. |
mode optional | строка | Defines the report mode. Acceptable values are: 'simple' (by default), 'fuzzy'. |
calculate_internal_fuzzy_matches optional | булево | Available for fuzzy mode only. Считает все внутренние совпадения, чтобы проверить, сколько строк можно добавить в TM, если строки переведены одна за другой, как указано в списке. Имейте в виду, что вычисления приблизительны, потому что строки могут быть переведены в другом порядке. Допустимые значения: 1 или 0. |
language обязательный | строка | The language for which the report should be generated. For this use Сrowdin language codes. |
date_from необязательный | дата | Strings added from. Use the following ISO 8601 date format: YYYY-MM-DD±hh:mm |
date_to необязательный | дата | Strings added to. Use the following ISO 8601 date format: YYYY-MM-DD±hh:mm |
normal_rates необязательный | массив | Defines the regular rates for the specified categories. Possible categories for a report in the simple mode are: 'default', 'tm', and 'approval'. Possible categories for a report in the fuzzy mode are: 'approval', 'translation', 'perfect', 'matched', and three customized ranges between 60% and 100% (for example: 99-90). |
individual_rates необязательный | массив | Определяет индивидуальные тарифы для указанных языков в указанных категориях. Каждый элемент должен содержать язык и параметры тарифа. Возможные типы тарифов такие же, как для параметра 'regular_rates'. |
currency необязательный | строка | Определяет валюту, для которой создается весь отчет. Допустимые значения: «$» (по умолчанию), «€», «¥», «£», «A $», «C $», «Fr», «CN ¥», «kr», «NZ $ ',' MX $ ',' S $ ',' HK $ ',' kr ',' ₩ ',' ₺ ',' ₽ ',' ₹ ',' R $ ',' R '. |
format необязательный | строка | Defines the export file format. Acceptable values are 'csv' and 'xlsx' (by default). |
json необязательный | строка | Может не содержать значения. Defines that the response should be in a JSON format. |
jsonp необязательный | строка | Название функции обратного вызова. Defines that the response should be in a JSONP format. |
Variables | ||
project-identifier | строка | Идентификатор проекта. |
login | строка | Ваше имя пользователя в Crowdin. |
account-key | строка | API ключ вашего аккаунта. |
<?xml version="1.0" encoding="UTF-8"?>
<success>
<hash>x1ff24323a2f6058382b31fbc237bcd74</hash>
</success>
<?xml version="1.0" encoding="UTF-8"?>
<error>
<code>3</code>
<message>API key is not valid</message>
</error>
curl \
-F "unit=chars" \
-F "mode=simple" \
-F "format=csv" \
-F "language=uk" \
-F "date_from=2017-01-01" \
-F "date_to=2017-01-03" \
-F "regular_rates[default]=1.05" \
-F "regular_rates[tm]=1.00" \
-F "regular_rates[approval]=2.00" \
https://api.crowdin.com/api/project/{project-identifier}/reports/costs-estimation/export?login={username}&account-key={account-key}
curl \
-F "unit=words" \
-F "mode=fuzzy" \
-F "format=xlsx" \
-F "language=uk" \
-F "date_from=2017-06-05+0200" \
-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/costs-estimation/export?login={username}&account-key={account-key}
<?php
$request_url = 'https://api.crowdin.com/api/project/{project-identifier}/reports/costs-estimation/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;