API V1 · Resources
List resource files
curl --request GET \ --url https://api.lingohub.com/v1/WORKSPACE_URL/projects/PROJECT_URL/resources \ --header 'Authorization: Bearer YOUR_API_KEY'import requests
url = "https://api.lingohub.com/v1/WORKSPACE_URL/projects/PROJECT_URL/resources"
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';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"
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") .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', [ '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")
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"), Headers = { { "Authorization", "Bearer YOUR_API_KEY" }, },};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}Returns the list of resource files belonging to the specified project. Each entry includes the file name, its associated locale, and a HATEOAS link for downloading the resource file. Use the localeInFileName parameter to control whether locale information is rendered in file names.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”WorkspaceUrl
ProjectUrl
Query Parameters
Section titled “Query Parameters”Determines if the locale info should be rendered in the file name: ALL(default), TARGETS, NONE
If true the iso2_slug parameter will be always added to the rendered resource file URLs
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 list of the project’s resource files.
A list of resource files belonging to a project, with HATEOAS navigation links.
object
The list of resource files in the project.
Information about a single resource file within a project, including its locale and HATEOAS links.
object
The name of the resource file including its extension.
HATEOAS links for the resource (e.g. self, download).
object
The locale (language code) of the resource file.
HATEOAS links for navigating the resource list (e.g. self).
object
Examples
Project with English and French JSON files
ResourceFileList
{ "members": [ { "name": "src/app/translations/lang/en.json", "links": [ { "rel": "self", "href": "https://api.lingohub.com/v1/lingohub/projects/lh-frontend/resources/en.json?path=src%2Fapp%2Ftranslations%2Flang", "type": "text/json" } ], "project_locale": "en" }, { "name": "src/app/translations/lang/fr.json", "links": [ { "rel": "self", "href": "https://api.lingohub.com/v1/lingohub/projects/lh-frontend/resources/fr.json?path=src%2Fapp%2Ftranslations%2Flang", "type": "text/json" } ], "project_locale": "fr" } ], "links": [ { "rel": "self", "href": "https://api.lingohub.com/v1/lingohub/projects/lh-frontend/resources?localeInFileName=ALL" } ]}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 or project 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"}