API V1 · Resources
Download a resource file
curl --request GET \ --url https://api.lingohub.com/v1/acme-corp/projects/my-project/resources/FILE_NAME \ --header 'Authorization: Bearer YOUR_API_KEY'import requests
url = "https://api.lingohub.com/v1/acme-corp/projects/my-project/resources/FILE_NAME"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
response = requests.get(url, headers=headers)
print(response.json())const url = 'https://api.lingohub.com/v1/acme-corp/projects/my-project/resources/FILE_NAME';const options = {method: 'GET', headers: {Authorization: 'Bearer YOUR_API_KEY'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}package main
import ( "fmt" "net/http" "io")
func main() {
url := "https://api.lingohub.com/v1/acme-corp/projects/my-project/resources/FILE_NAME"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer YOUR_API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder() .url("https://api.lingohub.com/v1/acme-corp/projects/my-project/resources/FILE_NAME") .get() .addHeader("Authorization", "Bearer YOUR_API_KEY") .build();
Response response = client.newCall(request).execute();<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.lingohub.com/v1/acme-corp/projects/my-project/resources/FILE_NAME', [ 'headers' => [ 'Authorization' => 'Bearer YOUR_API_KEY', ],]);
echo $response->getBody();require 'uri'require 'net/http'
url = URI("https://api.lingohub.com/v1/acme-corp/projects/my-project/resources/FILE_NAME")
http = Net::HTTP.new(url.host, url.port)http.use_ssl = true
request = Net::HTTP::Get.new(url)request["Authorization"] = 'Bearer YOUR_API_KEY'
response = http.request(request)puts response.read_bodyusing System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Get, RequestUri = new Uri("https://api.lingohub.com/v1/acme-corp/projects/my-project/resources/FILE_NAME"), Headers = { { "Authorization", "Bearer YOUR_API_KEY" }, },};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}Downloads the specified resource file from the project. Supports extensive export customization through query parameters including blank content handling, status filtering, character encoding, HTML encoding, and format conversion (e.g. export an iOS .strings file as Android XML). The response body contains the raw file content with appropriate content type headers. The response carries a weak ETag; send it back as If-None-Match to receive 304 Not Modified without a body while nothing in the project changed (If-Modified-Since alone is not evaluated: HTTP dates cannot tell two changes within one second apart). Send Accept-Encoding: gzip to receive the file compressed.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The URL slug of the workspace. The project links that GET /v1/projects returns contain it: /v1/{workspaceUrl}/projects/{projectUrl}.
Example
acme-corpThe URL slug of the project within its workspace. The project links that GET /v1/projects returns contain it: /v1/{workspaceUrl}/projects/{projectUrl}.
Example
my-projectName of the resource file to download
Query Parameters
Section titled “Query Parameters”Path of the resource file to download. if the fileName won’t be unique.
The iso code of the resource file locale. Overrides the language information that might be given in the path. Alias of ‘iso2_code’.
The iso code of the resource file locale. Overrides the language information that might be given in the path. Alias of ‘iso2_slug’.
How to export a segment whose source text is blank: skip leaves it out of the file; every other value keeps it.
How to export a segment whose target text is blank: skip leaves it out of the file; every other value keeps it.
Filter for source segments based on status.
Filter for target segments based on status.
If the segment content holds HTML. How should it be escaped
The character set encoding the file should have.
Alias of ‘htmlEncoding’
If the language information should be added to the filename.
If special characters should be escaped. Different behavior according to resource type.
Should comments be exported to files of the target language
Overrides the project type of the project for this export. Enables to eg. download an iOS file as Android XML or vice versa.
Name of the project branch. If omitted, the project’s default branch is used. Returns 422 if the branch name does not exist in the project.
Responses
Section titled “Responses”Successfully returns the content of the specified resource file as a byte stream.
Not Modified: the If-None-Match validator still matches, the file the client holds is current.
Unauthorized: Authentication credentials are missing or invalid.
object
object
object
object
object
Example
{ "error": { "status": "100 CONTINUE" }}Forbidden: The authenticated user does not have resource view permission on this project.
object
Example generated
{ "url": "example", "message": "example", "text": "example"}Not Found: The workspace or project does not exist (V1NotFoundResponse), or no resource file matches the name, path and language (V1ErrorInfo).
Unprocessable Entity: The specified branch name does not exist in the project.
object
object
object
object
object
Example
{ "error": { "status": "100 CONTINUE" }}Internal Server Error: An unexpected error occurred during resource file export.
object
Example generated
{ "url": "example", "message": "example", "text": "example"}