update_units

To add units to a retranslator, remove them from it, or change their retranslation settings, use the retranslator/update_units method.

Endpoint

Copied!
svc=retranslator/update_units&params={
    "itemId": <long>,
    "units": [{
        "i": <long>,
        "a": <text>,
        "st": <uint>
    }],
    "callMode": <text>
}

Parameters

The request can contain the following parameters. The required parameters are marked with an asterisk (*).

Parameter Description
itemId* Retranslator ID.
units* Array of units for retransmission.
i* Unit ID.
a* Unit identifier (alias) under which the unit is retranslated to the receiving server. It can differ from the unit ID.
st Time (Unix timestamp) when the unit is automatically removed from the retranslator. If the value is 0 or the parameter isn’t specified, the unit isn’t removed automatically.
callMode Mode of the request:
  • add: adds the specified units and updates the settings of those already added to the retranslator;
  • remove: removes the specified units from the retranslator;
  • not specified: adds the specified units and removes all the other units from the retranslator.

Response

If the request is completed successfully, the current list of the retranslator units is returned in the following format:

Copied!
{
    "rtru":[
        {
            "i":<long>,   /* Unit ID. */
            "a":<text>,   /* Unit identifier (alias) under which the unit is retranslated to the receiving server. It can differ from the unit ID. */
            "st":<uint>   /* Time (Unix timestamp) when the unit is automatically removed from the retranslator. 0 if the time isn't set. */
        }
    ]
}

Otherwise, an error code is returned.

Error codes

Error code Description
4 Failed to parse the input parameters or to get the current list of the retranslator units.
6 Failed to generate the response.
7 The specified item isn’t a retranslator, or the user has no access right to edit the retranslator settings including its start and stop (ACL bit 0x100000, see Tokens).

If you find a mistake in the text, please select it and press Ctrl+Enter.