Skip to content

API V1 · Resources

Download a resource file

GET
/v1/{workspaceUrl}/projects/{projectUrl}/resources/{fileName}
curl --request GET \
--url https://api.lingohub.com/v1/acme-corp/projects/my-project/resources/FILE_NAME \
--header 'Authorization: Bearer YOUR_API_KEY'

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.

workspaceUrl
required
string

The URL slug of the workspace. The project links that GET /v1/projects returns contain it: /v1/{workspaceUrl}/projects/{projectUrl}.

Example

acme-corp
projectUrl
required
string

The URL slug of the project within its workspace. The project links that GET /v1/projects returns contain it: /v1/{workspaceUrl}/projects/{projectUrl}.

Example

my-project
fileName
required
string

Name of the resource file to download

path
string

Path of the resource file to download. if the fileName won’t be unique.

iso2_slug
string

The iso code of the resource file locale. Overrides the language information that might be given in the path. Alias of ‘iso2_code’.

iso2_code
string

The iso code of the resource file locale. Overrides the language information that might be given in the path. Alias of ‘iso2_slug’.

source:blankContentHandling

How to export a segment whose source text is blank: skip leaves it out of the file; every other value keeps it.

string
Allowed values: fallback use_source master_locale keep blank skip
target:blankContentHandling

How to export a segment whose target text is blank: skip leaves it out of the file; every other value keeps it.

string
Allowed values: fallback use_source master_locale keep blank skip
source:filterByStatus

Filter for source segments based on status.

string
Allowed values: ALL TRANSLATED_AND_APPROVED TRANSLATED_AND_REVIEWED APPROVED REVIEWED
target:filterByStatus

Filter for target segments based on status.

string
Allowed values: ALL TRANSLATED_AND_APPROVED TRANSLATED_AND_REVIEWED APPROVED REVIEWED
htmlEncoding

If the segment content holds HTML. How should it be escaped

string
Allowed values: RAW ESCAPE CDATA
encoding
string

The character set encoding the file should have.

escapeMode
string
Allowed values: RAW ESCAPE CDATA

Alias of ‘htmlEncoding’

addLocaleInformationToFilename

If the language information should be added to the filename.

string
Allowed values: ALL TARGETS NONE
escapeCharacters
boolean

If special characters should be escaped. Different behavior according to resource type.

exportTargetComments
boolean

Should comments be exported to files of the target language

projectType
string
Allowed values: ios.strings ios.stringsdict android.string.resources properties standard_json

Overrides the project type of the project for this export. Enables to eg. download an iOS file as Android XML or vice versa.

branch
string

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.

Successfully returns the content of the specified resource file as a byte stream.

Media type*/*
string format: byte

Not Modified: the If-None-Match validator still matches, the file the client holds is current.

Unauthorized: Authentication credentials are missing or invalid.

Media typeapplication/json
object
error
object
code
string
description
string
status
string
Allowed values: 100 CONTINUE 101 SWITCHING_PROTOCOLS 102 PROCESSING 103 EARLY_HINTS 200 OK 201 CREATED 202 ACCEPTED 203 NON_AUTHORITATIVE_INFORMATION 204 NO_CONTENT 205 RESET_CONTENT 206 PARTIAL_CONTENT 207 MULTI_STATUS 208 ALREADY_REPORTED 226 IM_USED 300 MULTIPLE_CHOICES 301 MOVED_PERMANENTLY 302 FOUND 303 SEE_OTHER 304 NOT_MODIFIED 307 TEMPORARY_REDIRECT 308 PERMANENT_REDIRECT 400 BAD_REQUEST 401 UNAUTHORIZED 402 PAYMENT_REQUIRED 403 FORBIDDEN 404 NOT_FOUND 405 METHOD_NOT_ALLOWED 406 NOT_ACCEPTABLE 407 PROXY_AUTHENTICATION_REQUIRED 408 REQUEST_TIMEOUT 409 CONFLICT 410 GONE 411 LENGTH_REQUIRED 412 PRECONDITION_FAILED 413 CONTENT_TOO_LARGE 413 PAYLOAD_TOO_LARGE 414 URI_TOO_LONG 415 UNSUPPORTED_MEDIA_TYPE 416 REQUESTED_RANGE_NOT_SATISFIABLE 417 EXPECTATION_FAILED 418 I_AM_A_TEAPOT 421 MISDIRECTED_REQUEST 422 UNPROCESSABLE_CONTENT 422 UNPROCESSABLE_ENTITY 423 LOCKED 424 FAILED_DEPENDENCY 425 TOO_EARLY 426 UPGRADE_REQUIRED 428 PRECONDITION_REQUIRED 429 TOO_MANY_REQUESTS 431 REQUEST_HEADER_FIELDS_TOO_LARGE 451 UNAVAILABLE_FOR_LEGAL_REASONS 500 INTERNAL_SERVER_ERROR 501 NOT_IMPLEMENTED 502 BAD_GATEWAY 503 SERVICE_UNAVAILABLE 504 GATEWAY_TIMEOUT 505 HTTP_VERSION_NOT_SUPPORTED 506 VARIANT_ALSO_NEGOTIATES 507 INSUFFICIENT_STORAGE 508 LOOP_DETECTED 509 BANDWIDTH_LIMIT_EXCEEDED 510 NOT_EXTENDED 511 NETWORK_AUTHENTICATION_REQUIRED
validationErrors
Array<object>
object
field
string
errors
Array<object>
object
code
string
description
string
parameters
object
key
additional properties

Example

{
"error": {
"status": "100 CONTINUE"
}
}

Forbidden: The authenticated user does not have resource view permission on this project.

Media typeapplication/json
object
url
string
message
string
text
string

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).

Media typeapplication/json
Any of:
object
message
required
string | null
items
required
Array<string> | null

Example generated

{
"message": "example",
"items": [
"example"
]
}

Unprocessable Entity: The specified branch name does not exist in the project.

Media typeapplication/json
object
error
object
code
string
description
string
status
string
Allowed values: 100 CONTINUE 101 SWITCHING_PROTOCOLS 102 PROCESSING 103 EARLY_HINTS 200 OK 201 CREATED 202 ACCEPTED 203 NON_AUTHORITATIVE_INFORMATION 204 NO_CONTENT 205 RESET_CONTENT 206 PARTIAL_CONTENT 207 MULTI_STATUS 208 ALREADY_REPORTED 226 IM_USED 300 MULTIPLE_CHOICES 301 MOVED_PERMANENTLY 302 FOUND 303 SEE_OTHER 304 NOT_MODIFIED 307 TEMPORARY_REDIRECT 308 PERMANENT_REDIRECT 400 BAD_REQUEST 401 UNAUTHORIZED 402 PAYMENT_REQUIRED 403 FORBIDDEN 404 NOT_FOUND 405 METHOD_NOT_ALLOWED 406 NOT_ACCEPTABLE 407 PROXY_AUTHENTICATION_REQUIRED 408 REQUEST_TIMEOUT 409 CONFLICT 410 GONE 411 LENGTH_REQUIRED 412 PRECONDITION_FAILED 413 CONTENT_TOO_LARGE 413 PAYLOAD_TOO_LARGE 414 URI_TOO_LONG 415 UNSUPPORTED_MEDIA_TYPE 416 REQUESTED_RANGE_NOT_SATISFIABLE 417 EXPECTATION_FAILED 418 I_AM_A_TEAPOT 421 MISDIRECTED_REQUEST 422 UNPROCESSABLE_CONTENT 422 UNPROCESSABLE_ENTITY 423 LOCKED 424 FAILED_DEPENDENCY 425 TOO_EARLY 426 UPGRADE_REQUIRED 428 PRECONDITION_REQUIRED 429 TOO_MANY_REQUESTS 431 REQUEST_HEADER_FIELDS_TOO_LARGE 451 UNAVAILABLE_FOR_LEGAL_REASONS 500 INTERNAL_SERVER_ERROR 501 NOT_IMPLEMENTED 502 BAD_GATEWAY 503 SERVICE_UNAVAILABLE 504 GATEWAY_TIMEOUT 505 HTTP_VERSION_NOT_SUPPORTED 506 VARIANT_ALSO_NEGOTIATES 507 INSUFFICIENT_STORAGE 508 LOOP_DETECTED 509 BANDWIDTH_LIMIT_EXCEEDED 510 NOT_EXTENDED 511 NETWORK_AUTHENTICATION_REQUIRED
validationErrors
Array<object>
object
field
string
errors
Array<object>
object
code
string
description
string
parameters
object
key
additional properties

Example

{
"error": {
"status": "100 CONTINUE"
}
}

Internal Server Error: An unexpected error occurred during resource file export.

Media typeapplication/json
object
url
string
message
string
text
string

Example generated

{
"url": "example",
"message": "example",
"text": "example"
}