Projektdetaljer

Hent Crowdin Projekt-oplysninger.

Forespørgsel

Bemærk: Brug kombinationen af projektidentifikator, brugernavn og kontonøgle for at videregive til dette slutpunkt.

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

Parametre

Navn Parameter Beskrivelse
xml valgfrit string Må ikke indeholde numerisk værdi. Definerer, at svaret skal være i XML-formatet.
json valgfri string Må ikke indeholde numerisk værdi. Definerer, at svaret skal være i JSON-formatet.
jsonp valgfri string Returkaldsfunktionsnavn. Definerer, at svaret skal være i JSONP-formatet.
Variabler
project-identifier string Projektidentifikator.
login string Dit brugernavn i Crowdin.
account-key string Din konto API-nøgle.

Svar

Hvis det lykkes, returnerer denne metode en XML-struktur som vist nedenfor.
<?xml version="1.0" encoding="UTF-8"?>
<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>mappe</node_type>
    <id>1</id>
    <name>test</name>
    <files>
      <item>
        <node_type>fil</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>fil</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>fil</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>open</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>Ukrainsk</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="UTF-8"?>
<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="UTF-8"?>
<error>
  <code>3</code>
  <message>API-nøgle er ugyldig</message>
</error>

Eksempler

curl https://api.crowdin.com/api/project/{project-identifier}/info?login={username}&account-key={account-key}&jsonp=mycallback
<?php
$request_url = 'https://api.crowdin.com/api/project/{project-identifier}/info?login={username}&account-key={account-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;

Var denne artikel nyttig?