{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":38746,"path":"platform-administration/dynamic-translation/integrate-translation-service-provider.md","title":"Integrate with a translation service provider","bundle":null,"doc_type":null,"release":"australia","body":"\n# Integrate with a translation service provider\n\nIntegrate with a third-party translation provider of your choice for machine translation of user-generated text.\n\n## Before you begin\n\n-   Create an account with your third-party translation service provider, and obtain the connection and credentials needed for integration.\n-   Role required: admin\n\n## About this task\n\nBy default Dynamic Translation provides partially preconfigured translator records for several third party services. However, you can also create your own custom integration for a different service provider.\n\nCustom integrations require you to create subflows for language detection and translation, including actions, in Workflow Studio.\n\nUse default subflows as examples when you build your own subflows. For example:\n\n-   Detect Language \\[detect\\_language\\_v4\\]\n-   Translate Text \\[translate\\_text\\_v3\\]\n\nFor background information, see [Workflow Studio](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/build-workflows/workflow-studio.md) and [Migrate customized Translator Configurations to v4 flows](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-administration/dynamic-translation/migrate-v4-dynamic-translation.md).\n\n## Procedure\n\n1.  Confirm your application scope, then navigate to **All** &gt; **Process Automation** &gt; **Workflow Studio**, and select **New**.\n\n    To map error codes try using actions in subflows. For example, the Translate Text subflow has a Translate Text action. On that action, you can select **Open in Action Designer**. In the **Action Outline** section of the Action Designer, you can select **Error Evaluation**. You can overwrite the default error status that a step produces at runtime by entering new status code and status message values. See [Action error evaluation](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/build-workflows/action-error-evaluation.md).\n\n    1.  Map error codes from your machine translation provider to the error codes and standardized error messages supported by ServiceNow.\n\n        |Error code|Error message|\n        |----------|-------------|\n        |40050|Error code to populate error messages from the machine translation provider instead of standardized error messages.|\n        |40051|Unknown error occurred.|\n        |40052|Text \\('text' field\\) has exceeded its maximum length.|\n        |40053|Source language is invalid.|\n        |40054|Target language is invalid.|\n        |40055|Request is not authorized because credentials are missing or invalid.|\n        |40056|Text cannot be translated to target languages.|\n\n    2.  Ensure that the inputs and output fields are in the following format for subflows.\n\n<table id=\"table_z5q_q5t_23b\"><thead><tr><th>\n\nField name\n\n</th><th>\n\nDescription\n\n</th><th>\n\nType\n\n</th></tr></thead><tbody><tr><td class=\"sub-head\" colspan=\"3\">\n\nInputs\n\n</td></tr><tr><td>\n\ntexts\n\n</td><td>\n\nInput texts whose language should be detected.Version v3 supports bulk detection \\(detection of multiple texts input in a single string\\). With the Xanadu Patch 3 release, version v4 supports [Exclusion Framework](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-administration/dynamic-translation/dyn-translation-exclusion-framework.md) as well as bulk detection.\n\n</td><td>\n\nArray.String\n\n</td></tr><tr><td class=\"sub-head\" colspan=\"3\">\n\nOutputs\n\n</td></tr><tr><td>\n\ndetections\n\n</td><td>\n\nInformation about the code and confidence of the languages detected by the translator and their respective alternatives, error codes, and error messages.-   Code: Language code of the detected language as specified by the translation service provider.\n-   Confidence: Value that indicates the confidence in the result. The value is between zero and one. A low value indicates a low confidence.\n For example, French text with confidence of 0.93\n\n```\n{ 'code' : 'fr',  'confidence' : '0.93'  }\n```\n\n For more information refer to the getDetectedLanguages section of [DynamicTranslation - Scoped](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/api-reference/server-api-reference/DynamicTranslation.md).\n\n</td><td>\n\nArray.Object. Each element of the Object is a String value.\n\n</td></tr><tr><td>\n\nstatus\n\n</td><td>\n\nStatus of the request.\n\n</td><td>\n\nChoice\n\n</td></tr></tbody>\n</table><table id=\"table_cgx_ntt_23b\"><thead><tr><th>\n\nField name\n\n</th><th>\n\nDescription\n\n</th><th>\n\nType\n\n</th></tr></thead><tbody><tr><td class=\"sub-head\" colspan=\"3\">\n\nInputs\n\n</td></tr><tr><td>\n\ntexts\n\n</td><td>\n\nTexts to be translated.Version v3 and above support bulk translation \\(translation of multiple texts input in a single string\\).\n\n</td><td>\n\nArray.String\n\n</td></tr><tr><td>\n\ntarget\\_languages\n\n</td><td>\n\nArray of language codes to which the text needs to be translated.For example,\n\n```\n['fr','it']\n```\n\n</td><td>\n\nArray String. Each element of the array is a String value.\n\n</td></tr><tr><td>\n\nsource\\_language\n\n</td><td>\n\nLanguage code of the source text.For example,\n\n```\nen\n```\n\n</td><td>\n\nString\n\n</td></tr><tr><td>\n\nadditional\\_parameters\n\n</td><td>\n\nArray of additional parameters. For example,\n\n```\n[{'parameter_name': 'textType', 'parameter_value': 'html'}]\n```\n\n</td><td>\n\nArray.Object. Each element of the array is an Object with String values.\n\n</td></tr><tr><td class=\"sub-head\" colspan=\"3\">\n\nOutputs\n\n</td></tr><tr><td>\n\ntranslations\n\n</td><td>\n\nTranslated texts in the specified target languages. Each element of the array is an Object containing target language and the translated text.For example,\n\n```\n[ \n{'target_language':'fr', 'translated_text':'Bonjour'}, \n{'target_language':'it', 'translated_text':'ciao'} \n]\n\n```\n\n For more information refer to the getTranslations section of [DynamicTranslation - Scoped](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/api-reference/server-api-reference/DynamicTranslation.md).\n\n</td><td>\n\nArray.Object. Each element of the array is an Object with String values.\n\n</td></tr><tr><td>\n\nstatus\n\n</td><td>\n\nStatus of the request.\n\n</td><td>\n\nChoice\n\n</td></tr></tbody>\n</table>        **Note:** Ensure that the **Run As** field is set to **User who initiates session** in the flow properties.\n\n2.  [Create a custom translator configuration](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-administration/dynamic-translation/create-custom-translator.md) for your service provider in the Translator Configurations table, and set the record to active.\n\n    When you create the record in the Translator Configurations table, search for the subflows you created in the previous step..\n\n3.  If your instance is on Xanadu Patch 3 or higher, and you intend to use Exclusion Framework, enter your translation provider's exclusion tags in the Exclusion Provider Pattern table.\n\n    Refer to your provider's documentation to obtain these tags. For more information about entering the tags, see [Add an Exclusion Provider Pattern](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-administration/dynamic-translation/dyn-translation-exclusion-provider.md).\n\n4.  Create a language code mapping to associate your provider's language codes to ServiceNow language codes.\n\n    For more information, see [Create a language code mapping](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-administration/dynamic-translation/create-language-code-mapping.md).\n\n\n## What to do next\n\nFor information about APIs, see [DynamicTranslation API](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-administration/dynamic-translation/dyn-translation-apis.md).\n\n-   **[Create a custom translator configuration](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-administration/dynamic-translation/create-custom-translator.md)**  \nConfigure Dynamic Translation for a third-party machine translation provider of your choice.\n\n**Parent Topic:**[Integration with other translation services](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-administration/dynamic-translation/integration-with-other-translation-services.md)\n\n"}}