list
To get the retranslation protocols available to the current user, use the retranslator/list method. The response contains both the standard protocols and the custom ones allowed for the account.
Endpoint
svc=retranslator/list¶ms={}
Parameters
The method has no parameters. Pass an empty object in the request.
Response
If the request is completed successfully, the response is returned in the following format:
{
"custom_retranslators": [ /* Custom protocols available to the user. */
{
"name": "apad_gps", /* Value for the "protocol" field of the configuration. */
"params": {
"fields": [ /* Fields of the configuration. */
{
"key": "server", /* Field name. */
"type": "name" /* Field type. */
},
{
"key": "api_key",
"type": "name"
},
{
"key": "password",
"type": "name"
}
],
"name": "APAD GPS", /* Protocol name shown in the interface. */
"public": 1 /* Availability to all users: 1 for yes, 0 for no. */
}
},
...
],
"retranslators": [ /* Standard protocols. */
{
"name": "wialon",
"params": {
"fields": [
{
"key": "server",
"type": "name"
},
{
"key": "port",
"type": "uint16",
"default": 20163 /* Default value of the field. */
},
{
"key": "attach_sensors",
"type": "bool"
}
]
}
},
...
]
}
A custom protocol is included in the response if it’s marked as public, if the account has the corresponding service enabled, or if the user has administrator rights. If no custom protocol is available, the custom_retranslators array is absent from the response. The retranslators array is always returned, and the protocols in it are described in the update_config method.
The description of a protocol depends on the protocol itself:
- The
typeof a field shows how to fill it in. Besidesname, the typesbool,int,int16,uint16, and others are used. - A field can have the
defaultkey with the value which the interface offers for it. It’s used both in the standard and in the custom protocols. - Apart from
fields,name, andpublic, theparamsobject of a custom protocol can contain other keys with the settings of this protocol, such assending_optionsorlocation_conversion.
Otherwise, an error code is returned.
Error codes
| Error code | Description |
|---|---|
| 5 | Failed to generate the response. |
| 6 | There is no user in the current session. |