Сведения о проекте

Просмотреть детали проекта на Crowdin.

Запрос

POST https://api.crowdin.com/api/project/{project-identifier}/info?key={project-key}

Параметры

Название Значение Описание
xml необязательный строка May not contain value. Defines that response should be in XML format.
json необязательный строка Может не содержать значение. Указывает, что ответ должен быть в формате JSON.
jsonp необязательный строка Callback function name. Defines that response should be in JSONP format.
Переменные
project-identifier обязательный строка Должен содержать идентификатор проекта.
project-key обязательный строка API-ключ проекта.

Ответ

If successful, this method returns a XML structure, as it is shown below.
<?xml version="1.0" encoding="ISO-8859-1"?>
<info>
  <languages> <!-- all project languages -->
    <item>
    <name>French</name>
    <code>fr</code>
    </item>
    <item>
    <name>Spanish</name>
    <code>es-ES</code>
    </item>
  </languages>
  <files> <!-- project files details -->
    <item>
    <node_type>directory</node_type>
    <id>1</id>
    <name>test</name>
    <files>
      <item>
        <node_type>файл</node_type>
        <id>2</id>
        <name>market-info.txt</name>
        <created>2017-05-19T13:08:13+0000</created>
        <last_updated>2017-05-20T18:02:13+0000</last_updated>
        <last_accessed>2017-05-21T09:10:48+0000</last_accessed>
        <last_revision>1</last_revision>
      </item>
      <item>
        <node_type>файл</node_type>
        <id>3</id>
        <name>strings.xml</name>
        <created>2017-05-19T13:38:15+0000</created>
        <last_updated>2017-05-20T18:42:11+0000</last_updated>
        <last_accessed>0000-00-00 00:00:00</last_accessed>
        <last_revision>1</last_revision>
      </item>
    </files>
    </item>
    <item>
      <node_type>файл</node_type>
      <id>4</id>
      <name>strings.xml</name>
      <created>2017-05-19T13:40:09+0000</created>
      <last_updated>2017-05-21T06:31:48+0000</last_updated>
      <last_accessed>2017-05-21T07:21:01+0000</last_accessed>
      <last_revision>1</last_revision>
    </item>
  </files>
  <details> <!-- project details -->
    <source_language>
      <name>English</name>
      <code>en</code>
    </source_language>
    <name>test-project</name>
    <identifier>test-project</identifier>
    <created>2017-05-19T13:40:52+0000</created>
    <description>project description</description>
    <join_policy>открытый</join_policy>
    <last_build>2017-05-20T20:01:18+0000</last_build>
    <last_activity>2017-05-21T09:10:48+0000</last_activity>
    <total_strings_count>438</total_strings_count>
    <total_words_count>4238</total_words_count>
    <duplicate_strings_count>228</duplicate_strings_count>
    <duplicate_words_count>2249</duplicate_words_count>
    <participants_count>4</participants_count>
    <logo_url>https://dvsyjmyregmxp.cloudfront.net/images/project-logo/14d5d32996cfcc6473ebe7fe2c9f3152105.png</logo_url>
    <invite_url>
      <item>
        <language>Ukrainian</language>
        <translator>
          https://crowdin.com/project/test-project/invite?d=d5l6k4h685v6p483v6q4r44303
        </translator>
        <proofreader>
          https://crowdin.com/project/test-project/invite?d=95l625i6r4v6p483v6q4r44303
        </proofreader>
      </item>
    </invite_url>
  </details>
</info>

Note!

last_updated field indicates last update of the file and last_accessed indicates last activity in the file (e. g. submitting a suggestion). If there were no activities such as last_build, last_activity or last_updated, the dates are shown in following format 0000-00-00T00:00:00+0000 in UTC.
If the language access policy is "Open" the invite URL section will look like the following:
<?xml version="1.0" encoding="ISO-8859-1"?>
<invite_url>
  <translator>
    https://crowdin.com/project/test-project/invite
  </translator>
  <proofreader>
    https://crowdin.com/project/test-project/invite?d=95l625i6r4v6p483v6q4r44303
  </proofreader>
</invite_url>
Unsuccessful response sample:
<?xml version="1.0" encoding="ISO-8859-1"?>
<error>
  <code>3</code>
  <message>API key is not valid</message>
</error>

Примеры

curl https://api.crowdin.com/api/project/{project-identifier}/info?key={project-key}&jsonp=mycallback
<?php
$request_url = 'https://api.crowdin.com/api/project/{project-identifier}/info?key={project-key}&xml';

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

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

echo $result;