Translate message via API

Translate message via API




Translate message via API.



Introduction

Welcome, this is a tutorial to translate a message via API.



Translate the message provided.

Arguments

URL
Require Authentication
Método HTTP

/api/v1/autotranslate.translateMessage


yes
POST


 Payloads

Argument
Example
Required
Description
messageId

Fq7sQNSnDEfzj8qoS

Required

The id of the message to be translated.

targetLanguage

en

Optional

The target language in which the message will be translated.


Call Example



  1. curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
     -H "X-User-Id: Z3cpiYN6CNK2oXWKv" \
     -H "Content-type: application / json" \
     http: // localhost: 3000 / api / v1 / autotranslate.translateMessage \
     -d '{
     "messageId": "Fq7sQNSnDEfzj8qoS",
     "targetLanguage": "en"
    } '

Result:
  1. {
        "message": {
            "_id": "Fq7sQNSnDEfzj8qoS",
            "rid": "GENERAL",
            "msg": "Isso é um teste",
            "ts": "2019-06-27T15:35:20.753Z",
            "u": {
                "_id": "pC6Z2N2ijivxdsYSu",
                "username": "marcos",
                "name": "marcos"
            },
            "_updatedAt": "2019-06-27T15:47:01.486Z",
            "mentions": [],
            "channels": [],
            "translations": {
                "en": "This is a test"
            }
        },
        "success": true
    }



In case of doubts or suggestions, please contact our support via e-mail: suportebr@myhive.global







    • Related Articles

    • Set status via API

      Set status via API. Introduction Welcome, this is a tutorial to help set status via API. Defines a user status when status message and status are provided. Arguments: URL Require Authentication Method HTTP /api/v1/users.setAvatar yes POST  Payloads ...
    • Disable users via API.

      Disable users via API. Introduction Welcome, this is a tutorial to disable user via API. Note: Disable inactive users. Permission required:    edit-other-user-active-status. Parameters URL Require Authentication Method HTTP ...
    • Paging via API

      Paging via API. Introduction Welcome, this is a tutorial to help understand how to count, offset, sort via API. As of version, some of the endpoints support query parameters, and . However, the defaults are different by server due to configuration ...
    • Creating user via API.

      Creating user via API. Introduction Welcome, this is a tutorial to login via API Parameters URL Require Authentication Method HTTP /api/v1/users.create yes POST Variables Note: To save customFields, you must first define customFields in the admin ...
    • Set Avatar Image via API

      Set Avatar Image via API. Introduction Welcome, this is a tutorial to set avatar image via API. Uploading a file. Arguments: URL Require Authentication Method HTTP /api/v1/users.setAvatar yes POST Payloads Arguments Example Required Description image ...