Problem/Motivation

As the maintainer of the tmgmt_deepl module and we (as company undpaul) want to take part in the new DeepL Partner programme. Therefore the User-Agent header needs to be changed.
To meet the programme’s requirement, a specific static partner-identifier value must be sent:
deepl-partner-integration-undpaul
We want to implement this in a way that is backward-compatible and gives users the ability to opt-out (i.e., disable the partner ID) via a simple checkbox.

Proposed resolution

  • add a new checkbox in the translator configuration form (DeepL translator settings in TMGMT) labelled for “Do not send the DeepL Partner ID in API requests.”.
    • This checkbox defaults to be unchecked (i.e., sending the partner ID by default).
    • If the user checks the box, the module falls back to the original header value tmgmt_deepl.

User interface changes

  • Checkbox Do not send the DeepL Partner ID in API requests. is availabel in translation settings
  • Description: If this option is enabled, the module will not send the partner identifier deepl-partner-integration-undpaul in each DeepL API request.
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

steffenr created an issue. See original summary.

steffenr’s picture

Title: Add Partner ID in User-Agent header for DeepL API requests » Add DeepL partner ID in User-Agent header for DeepL API requests
steffenr’s picture

Title: Add DeepL partner ID in User-Agent header for DeepL API requests » Add DeepL partner ID in User-Agent header for API requests
steffenr’s picture

Issue summary: View changes
steffenr’s picture

The application to the partner program has been approved. The MR will be merged and a new release will be created.

  • steffenr committed 62785fa1 on 2.3.x
    [#3554544] feat: add DeepL partner id in User-Agent header for API...
idebr’s picture

Why default installations to deepl-partner-integration-undpaul?

steffenr’s picture

Issue summary: View changes
steffenr’s picture

@idebr: Passing a partner id was part of the requirement to get enrolled in the partner program. For reasons of transparency i've added a note to the module page telling about the new header value. The setting can be easily disabled within the translator plugin settings.

Further info
In order to track and attribute usage of the integration, the integration partner must include the following identifier in the user agent of all DeepL API requests made by the integration.
We spoke to a representative of DeepL because we were unsure of how to solve this in an open-source project such as Drupal, and they asked us to add it as an opt-out.

steffenr’s picture

Assigned: steffenr » Unassigned
Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

idebr’s picture

Then perhaps make partner id a string in the configuration object? It doesn't make a lot of sense outside on projects managed outside undpaul

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.