Poznámka
Na prístup k tejto stránke sa vyžaduje oprávnenie. Môžete sa skúsiť prihlásiť alebo zmeniť adresáre.
Na prístup k tejto stránke sa vyžaduje oprávnenie. Môžete skúsiť zmeniť adresáre.
Omnikanál pre Customer Service ponúka súbor funkcií, ktoré rozširujú možnosti Dynamics 365 Customer Service Enterprise a umožňujú organizáciám okamžite sa spojiť a komunikovať so zákazníkmi prostredníctvom kanálov digitálnych správ. Na prístup k Omnikanálu pre Customer Service je potrebná ďalšia licencia. Ďalšie informácie nájdete na stránkach Prehľad cien aplikácie Dynamics 365 Customer Service a Prehľad cien aplikácie Dynamics 365 Customer Service.
Táto metóda musí byť implementovaná vo webovom zdroji. Táto metóda sa volá pre každú konverzačnú správu vymenenú medzi zákazníkom a agentom, ak je zapnutý preklad a ak správa nebola preložená skôr v konverzácii pre cieľový jazyk.
Dôležité
Ďalšie informácie o implementácii rozhrania API nájdete v tomto vzorovom webovom zdrojitranslateMessage.
Syntax
function (conversationId, translationConfig): Object
Parametre
| Name | Type | Popis |
|---|---|---|
translationConfig |
Objekt JavaScript | Pozostáva z conversationIdpárov kľúč-hodnota a messagePayloadtranslateToC1orC2 . |
Tu je štruktúra parametra translationConfig .
export class UserType {
public static readonly C1 = "Agent"; //Used if the sender of the message is agent
public static readonly C2 = "Customer"; //Used if the sender of the message is customer
public static readonly CONSULT = "Consult Agent"; //Used if the sender of the message is other than agent or customer
}
export class TranslateTo {
public static readonly C1 = "Agent"; //Used if message is translated for agent
public static readonly C2 = "Customer"; //Used if message is translated for customer
}
export class MessageContentType {
public static readonly Text = "Text"; //Used if the content type is text
}
interface Sender {
userType: UserType; //Points to any static field in UserType type,Represents the type of the user who is sending this message
}
interface MessagePayload {
content: string; //Contains the content to be translated
contentType: MessageContentType; //Points to any static field in MessageContentType type,Represents the type of message content. For example: "Text" etc.
sender: Sender; //Implements Sender interface, Represents the sender of the message
}
interface translationConfig {
conversationId: string; //Unique Id for conversation in Omnichannel for Customer Service
messagePayload: MessagePayload; //Implements MessagePayload interface, Represents the payload for the message to be translated
translateToC1orC2: TranslateTo; //Points to any static field in TranslateTo type,Represents for whom the message has to be translated
}
Tu je ukážka parametra conversationConfig .
translationConfig = {
"conversationId": "2b330c52-6844-4d36-8e05-03c78c9681dc",
"messagePayload": {
"content": "Hello",
"contentType": "Text",
"sender": {
"userType": "Agent"
}
},
"translateToC1orC2": "Customer"
}
Vrátená hodnota
Vráti prísľub, ktorý sa vyrieši na rozhranie implementujúce TranslatedMessageResponse objekt JavaScript.
Objekt rozhrania
export interface ErrorObject{
isError: boolean; //mandatory field, represents true for error while executing this function else no
errorCode: ErrorCodes; //mandatory field, represents the type of error based on errorCode
}
export interface TranslatedMessageResponse {
translatedMessage: string; //mandatory field, Contains the translated message
sourceLanguage: string; //mandatory field, represents the language locale of the original content
destinationLanguage: string; //mandatory field, represents the language locale of the translated content
errorObject?: ErrorObject; //optional field, represents the error object for any error scenarios
}
Parameter errorCode in ErrorObject predstavuje chyby iba z nasledujúceho zoznamu.
| Chybové hlásenie | Kód chyby | Popis |
|---|---|---|
| MESSAGE_TOO_LONG | 100 | Chybový kód pre veľmi dlhú správu, ktorú prekladateľská služba nedokáže preložiť |
| LANGUAGE_NOT_SUPPORTED | 101 | Kód chyby pre jazyk, ktorý prekladateľská služba nepodporuje |
| MESSAGE_NOT_TRANSLATED | 102 | Kód chyby pre správu, ktorú prekladateľská služba nepreložila |
| TRANSLATION_SERVICE_LIMIT_EXCEEDED | 103 | Kód chyby pri prekročení limitu kvóty pre prekladateľskú službu |
| TRANSLATION_FAILED | 104 | Kód chyby, ak prekladateľská služba nedokázala preložiť správu |
| UNRECOGNIZED_TEXT | 105 | Kód chyby, ak prekladateľská služba nerozpozná text |
| UNRECOGNIZED_ERROR | 200 | Kód chyby, ak sa vyskytne iná chyba ako uvedená. |
Parameter sourceLanguage and destinationLanguage v TranslatedMessageResponse rozhraní predstavuje ID miestneho nastavenia. Ďalšie informácie: Identifikátor miestneho nastavenia.
Ukradnutá odpoveď
{
"translatedMessage": "Hola",
"destinationLanguage": "3082",
"errorObject": {
"isError": false,
"errorCode": null
},
"sourceLanguage": "3082"
}
Poznámka
- V prípade výnimky počas vykonávania tejto metódy sa Omnikanál pre Customer Service nebude opakovať a namiesto toho zobrazí chybové hlásenie o zlyhaní prekladu.
- Chybu pri vykonávaní tejto metódy je možné upozorniť cez
errorObject. V prípade chyby sa Omnikanál pre Customer Service nepokúsi znova a namiesto toho zobrazí chybové hlásenie na základe zadaných kódov chýb. - V prípade, že je vrátená odpoveď neplatná alebo neúplná, v ovládacom prvku konverzácie sa na banneri prekladu zobrazí chybové hlásenie.
- Ak táto metóda nie je implementovaná, správa sa nepreloží a agentovi sa zobrazí nasledujúce chybové hlásenie.