API V1 · Resources
Download a resource file
curl --request GET \ --url https://api.lingohub.com/v1/WORKSPACE_URL/projects/PROJECT_URL/resources/FILE_NAME \ --header 'Authorization: Bearer YOUR_API_KEY'import requests
url = "https://api.lingohub.com/v1/WORKSPACE_URL/projects/PROJECT_URL/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/WORKSPACE_URL/projects/PROJECT_URL/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/WORKSPACE_URL/projects/PROJECT_URL/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/WORKSPACE_URL/projects/PROJECT_URL/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/WORKSPACE_URL/projects/PROJECT_URL/resources/FILE_NAME', [ 'headers' => [ 'Authorization' => 'Bearer YOUR_API_KEY', ],]);
echo $response->getBody();require 'uri'require 'net/http'
url = URI("https://api.lingohub.com/v1/WORKSPACE_URL/projects/PROJECT_URL/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/WORKSPACE_URL/projects/PROJECT_URL/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”WorkspaceUrl
ProjectUrl
Name 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’.
Should the segment be exported if source content is blank.
Should the segment be exported if target content is blank.
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
If a resource file holds multiple languages, this indicates if the source language should be included in this export.
If the file header (if applicable) should be exported.
If the title of a segment (if applicable) should be exported.
If a resource file holds multiple languages, this indicates if the description of the segments should be exported at all.
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
Example generated
{ "url": "example", "message": "example", "text": "example"}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 specified workspace, project, or resource file does not exist.
object
Example generated
{ "url": "example", "message": "example", "text": "example"}Unprocessable Entity: The specified branch name does not exist in the project.
object
Example generated
{ "url": "example", "message": "example", "text": "example"}Internal Server Error: An unexpected error occurred during resource file export.
object
Example generated
{ "url": "example", "message": "example", "text": "example"}