Google Translate
15 min
the swimlane google translate connector integrates with swimlane turbine to do the translate text from spam emails & strings found in malware analysis prerequisites this connector requires a oauth client ids for setting up oauth 2 0 client id & token https //support google com/cloud/answer/6158849 https //support google com/cloud/answer/6158849 capabilities the swimlane google translate connector has the following capabilities language translate credentials information when this document uses the term user account, it refers to a google account, or a user account managed by your identity provider and federated with workforce identity federation for authentication, credentials are a digital object that provide proof of identity passwords, pins, and biometric data can all be used as credentials, depending on the application requirements for example, when you log into your user account, you provide your password and satisfy any two factor authentication requirement as proof that the account in fact belongs to you, and you are not being spoofed by a bad actor tokens are sometimes referred to as credentials, but for this documentation, they are instead referred to as a digital object that proves that the caller provided proper credentials, but they are not credentials themselves the type of credential you need to provide depends on what you are authenticating to the following types of credentials can be created in the google cloud console oauth client ids oauth client ids are used to identify an application to google this is necessary when you want to access resources owned by your end users, also called three legged oauth (3lo) for more information about how to get and use an oauth client id, see setting up oauth 2 0 authorization authorization requires one of the following oauth scopes https //www googleapis com/auth/cloud translation https //www googleapis com/auth/cloud translation https //www googleapis com/auth/cloud platform https //www googleapis com/auth/cloud platform for more information, see the auth guide https //cloud google com/docs/authentication/ https //cloud google com/docs/authentication/ configurations google authentication authenticates using google credentials configuration parameters parameter description type required credentials base64 encoded contents from service account json credentials file see readme for setup instructions string optional delegate account account to execute integrations under if not specified, the integration will run as a service account using a service account will introduce limitations see readme string optional client id the client id for the oauth 2 0 application string required client secret the client secret for the oauth 2 0 application string required refresh token oauth 2 0 refresh token used to obtain new access tokens if using a refresh token, you must also provide a client id and secret string required actions language returns a list of supported languages for translation endpoint url /language/translate/v2/languages method get input argument name type required description target string optional the target language code for the results if specified, then the language names are returned in the name field of the response, localized in the target language if you do not supply a target language, then the name field is omitted from the response and only the language codes are returned model string optional the supported languages for a particular translation model for cloud translation basic, the value can be nmt to return languages supported by the neural machine translation (nmt) model key string optional a valid api key to handle requests for this api if you are using oauth 2 0 service account credentials (recommended), do not supply this parameter output parameter type description status code number http status code of the response data object response data languages array output field languages language string output field language name string name of the resource example \[ { "status code" 200, "response headers" {}, "json body" { "data" {} } } ] translate translates input text, returning translated text endpoint url /language/translate/v2 method post input argument name type required description q string required the input text to translate provide an array of strings to translate multiple phrases the maximum number of strings is 128 target string required the language to use for translation of the input text, set to one of the language codes listed in language support format string optional the format of the source text, in either html (default) or plain text a value of html indicates html and a value of text indicates plain text source string optional the language of the source text, set to one of the language codes listed in language support if the source language is not specified, the api will attempt to detect the source language automatically and return it within the response model string optional the translation model cloud translation basic offers only the nmt neural machine translation (nmt) model if the model is base, the request is translated by using the nmt model key string optional a valid api key to handle requests for this api if you are using oauth 2 0 service account credentials (recommended), do not supply this parameter output parameter type description status code number http status code of the response data object response data translations array output field translations detectedsourcelanguage string output field detectedsourcelanguage model string output field model translatedtext string output field translatedtext example \[ { "status code" 200, "response headers" {}, "json body" { "data" {} } } ] notes google translate api documentation https //cloud google com/translate/docs/reference/rest/v2/translate#translatetextresponselist https //cloud google com/translate/docs/reference/rest/v2/translate#translatetextresponselist https //cloud google com/translate/docs/reference/rest/v2/languages https //cloud google com/translate/docs/reference/rest/v2/languages for setting up oauth 2 0 client id & token https //support google com/cloud/answer/6158849 https //support google com/cloud/answer/6158849 for language support https //cloud google com/translate/docs/languages https //cloud google com/translate/docs/languages