Problemas Reportados

Get a list of issues reported in the Editor.

Pedido

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

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

Parâmetros

Nome Valor Descrição
type opcional string Defines the issue type.
Os valores aceitáveis são:
  • "general_question" — general question
  • "translation_mistake" — current translation is wrong
  • "context_request" — lack of contextual information
  • "source_mistake" — mistake in the source string
  • "all" — all the issue types listed above (default value)
estado opcional string Defines the issue resolution status.
Os valores aceitáveis são:
  • "unresolved" — unresolved issues
  • "resolved" — resolved issues
  • "all" — all the issue resolution statuses listed above (default value)
file optional string Defines the path of the file issues are associated with.
If the file path is not specified the method will get issues associated with all the project files.
idioma opcional string Defines the language issues are associated with. If the language is not specified the method will get issues associated with all the project languages.
Crowdin language codes.
date_from optional string Issues added from. Use the following ISO 8601 format: YYYY-MM-DD±hh:mm
date_to optional string Issues added to. Use the following ISO 8601 format: YYYY-MM-DD±hh:mm
json opcional string May contain no value. Defines that the response should be in JSON.
jsonp opcional string Nome da função de retorno de chamada. Defines that the response should be in JSONP.
Variáveis
project-identifier string Identificador do projeto.
project-key string Chave da API do projeto. Tanto a project-key ou a combinação de login e account-key são obrigatórias.
login string O teu nome de utilizador no Crowdin. Tanto a project-key ou a combinação de login e account-key são obrigatórias.
account-key string A tua chave API de conta. Tanto a project-key ou a combinação de login e account-key são obrigatórias.

Resposta

If the method is successful it returns an XML structure, as it's shown below:
<?xml version="1.0" encoding="UTF-8"?>
<issues>
    <issue>
        <source_string>Nome do projeto</source_string>
        <context>Headline 3 XPath: /html/body/div/div/h3</context>
        <comment>Source string mistake</comment>
        <created>2017-12-18T14:19:05+0000</created>
        <type>source_mistake</type>
        <status>unresolved</status>
        <file>/crowdin_sample_webpage.html</file>
        <language>
            <name>Francês</name>
            <code>fr</code>
        </language>
        <string_url>https://crowdin.com/translate/project-issues/3624/en-uk#14342648</string_url>
        <user>John Doe</user>
    </issue>
    <issue>
        <source_string>Current Password</source_string>
        <context>current_password</context>
        <comment>wrong translation</comment>
        <created>2017-12-18T14:18:29+0000</created>
        <type>translation_mistake</type>
        <status>unresolved</status>
        <file>/crowdin_sample_android.xml</file>
        <language>
            <name>Francês</name>
            <code>fr</code>
        </language>
        <string_url>https://crowdin.com/translate/project-issues/3625/en-uk#14342682</string_url>
        <user>John Doe</user>
    </issue>
    <issue>
        <source_string>Início Rápido</source_string>
        <context>quick_start</context>
        <comment>Need more context</comment>
        <created>2017-12-18T14:18:01+0000</created>
        <type>context_request</type>
        <status>unresolved</status>
        <file>/crowdin_sample_android.xml</file>
        <language>
            <name>Francês</name>
            <code>fr</code>
        </language>
        <string_url>https://crowdin.com/translate/project-issues/3625/en-uk#14342693</string_url>
        <user>John Doe</user>
    </issue>
</issues>
Exemplo de resposta mal-sucedida:
<?xml version="1.0" encoding="UTF-8"?>
<error>
    <code>1</code>
    <message>The requested project does not exist or the API key is not valid.</message>
</error>

Exemplos

  curl \
    -F "type=general_question" \
    -F "status=unresolved" \
    -F "date_from=2017-01-01" \
    https://api.crowdin.com/api/project/{project-identifier}/issues?key={project-key}
<?php
$post_params = array();
$request_url = 'https://api.crowdin.com/api/project/{project-identifier}/issues?key={project-key}';
$post_params['type'] = 'general_question';
$post_params['status'] = 'unresolved';
$post_params['date_from'] = '2017-01-01';

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

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

echo $result;

Este artigo foi útil?