Skip to main content

crowdin app api

Description​

Call one of the application's API methods

Synopsis​

crowdin app api <identifier> <path> [OPTIONS]

Arguments​

<identifier>
Application identifier, as printed by 'crowdin app list'

<path>
API method path, optionally with a query string

Options​

-X, --method=…
HTTP method: GET, POST, PUT, PATCH or DELETE

-f, --field=…
Add a string field as key=value. Repeat 'key[]=value' to send an array

-F, --typed-field=…
Add a field as key=value, converting true, false, null and integers, and reading @file

--input=…
Read the JSON request body from a file, or '-' for stdin

--dryrun
Print a command output without execution

-h, --help
Display help message and exit

Config Options​

-T, --token=…
Personal access token required for authentication

--base-url=…
Base URL of Crowdin server for API requests execution

--base-path=…
Path to your project directory on a local machine

Global Options​

-v, --verbose
Provide more information about the command execution

-c, --config=…
Specify a path to the configuration file

--identity=…
Specify a path to user-specific credentials

--no-colors
Disable colors and styles

--no-progress
Disable progress on executed command

-o, --output=…
Change output format (choices: "json", "toon", "plain")

Examples​

Read the application settings of a project:

crowdin app api zendesk-guide settings -F projectId=12

Import selected items, sending an array with the key[]=value form:

crowdin app api zendesk-guide crowdin-update -X POST -F projectId=12 -f 'entryIds[]=cam_1' -f 'entryIds[]=cam_2'

Send a request body from a file:

crowdin app api zendesk-guide integration-update --input body.json

Cancel a job:

crowdin app api zendesk-guide jobs -X DELETE -F projectId=12 -F jobId=067d…

Print the request without sending it:

crowdin app api zendesk-guide 'job-info?projectId=12&jobId=067d…' --dryrun

Notes​

  • The method defaults to GET, or POST when --input is given. Fields never change it, so pass -X POST to write.
  • With GET and DELETE, fields are sent as query parameters. With POST, PUT and PATCH, they form the JSON body.
  • -f sends the value as a string. -F converts true, false, null and integers, and reads @file.
  • A key ending in [] collects its values into an array. Giving a plain key twice is an error.
  • Put -f and -F after <identifier> <path>. A field flag takes every following word up to the next option as a value, so a path written after it would be read as a field.
  • The result is the application's JSON response. Errors returned by the application are printed with its own message.
  • The token needs the application.proxy scope.