แชร์ผ่าน


แปลข้อความ

ช่องทาง Omni สำหรับ Customer Service นำเสนอชุดความสามารถที่ขยายศักยภาพของ Dynamics 365 Customer Service Enterprise เพื่อเปิดองค์กรสู่การเชื่อมต่อและมีส่วนร่วมกับลูกค้าได้ทันทีผ่านช่องทางการส่งข้อความดิจิทัล จำเป็นต้องมีใบอนุญาตเพิ่มเติมเพื่อเข้าถึงช่องทาง Omni สำหรับ Customer Service สำหรับข้อมูลเพิ่มเติม โปรดดูที่หน้า ภาพรวมการกำหนดราคา Dynamics 365 Customer Service และ แผนการกำหนดราคา Dynamics 365 Customer Service

จําเป็นต้องใช้วิธีนี้ในทรัพยากรบนเว็บ วิธีการนี้ถูกเรียกสําหรับทุกข้อความการสนทนาที่แลกเปลี่ยนระหว่างลูกค้าและตัวแทน หากการแปลเปิดอยู่ และหากข้อความยังไม่ได้รับการแปลก่อนหน้านี้ในการสนทนาสําหรับภาษาปลายทาง

สําคัญ

ดูแหล่งข้อมูล บนเว็บตัวอย่าง นี้สําหรับข้อมูลเพิ่มเติมเกี่ยวกับวิธีการใช้งาน translateMessage API

Syntax

function (conversationId, translationConfig): Object

พารามิเตอร์

ชื่อ ประเภท คำอธิบาย
translationConfig วัตถุ JavaScript ประกอบด้วยคู่ conversationIdและ messagePayload คู่ translateToC1orC2 คีย์-ค่า

นี่คือโครงสร้างของ 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 
 } 

นี่คือตัวอย่างของ conversationConfig พารามิเตอร์

translationConfig = {
  "conversationId": "2b330c52-6844-4d36-8e05-03c78c9681dc",
  "messagePayload": {
    "content": "Hello",
    "contentType": "Text",
    "sender": {
      "userType": "Agent"
    }
  },
  "translateToC1orC2": "Customer"
}

ส่งคืนค่า

ส่งคืนคําสัญญาที่แก้ไขเป็นอินเตอร์เฟสที่ใช้วัตถุ TranslatedMessageResponse JavaScript

วัตถุอินเทอร์เฟซ

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
}

errorCodeพารามิเตอร์ in ErrorObject แสดงข้อผิดพลาดจากรายการต่อไปนี้เท่านั้น

ข้อความแสดงข้อผิดพลาด รหัสข้อผิดพลาด คำอธิบาย
MESSAGE_TOO_LONG 100 รหัสข้อผิดพลาดสําหรับข้อความที่ยาวมากซึ่งบริการแปลไม่สามารถแปลได้
LANGUAGE_NOT_SUPPORTED 101 รหัสข้อผิดพลาดสําหรับภาษาที่ไม่รองรับโดยบริการแปล
MESSAGE_NOT_TRANSLATED 102 รหัสข้อผิดพลาดสําหรับข้อความที่ไม่ได้แปลโดยบริการแปล
TRANSLATION_SERVICE_LIMIT_EXCEEDED 103 รหัสข้อผิดพลาดหากเกินขีดจํากัดโควต้าสําหรับบริการแปล
TRANSLATION_FAILED 104 รหัสข้อผิดพลาดหากบริการแปลไม่สามารถแปลข้อความได้
UNRECOGNIZED_TEXT 105 รหัสข้อผิดพลาดหากบริการแปลไม่รู้จักข้อความ
UNRECOGNIZED_ERROR 200 รหัสข้อผิดพลาดหากมีข้อผิดพลาดอื่นนอกเหนือจากที่ระบุไว้

sourceLanguageพารามิเตอร์ and destinationLanguage ในTranslatedMessageResponseอินเทอร์เฟซแสดงถึงรหัสตําแหน่งที่ตั้ง ข้อมูลเพิ่มเติม: รหัสตําแหน่งที่ตั้ง

ตัวอย่างการตอบสนอง

{
  "translatedMessage": "Hola",
  "destinationLanguage": "3082",
  "errorObject": {
    "isError": false,                             
    "errorCode": null
  },
  "sourceLanguage": "3082"
}

Note

  • ในกรณีที่มีข้อยกเว้นระหว่างการดําเนินการตามวิธีการนี้ ช่องทาง Omni สําหรับ Customer Service จะไม่ลองใหม่ และจะแสดงข้อความแสดงข้อผิดพลาดการแปลล้มเหลวแทน
  • ข้อผิดพลาดขณะเรียกใช้วิธีนี้สามารถแจ้งได้ผ่านerrorObject ในกรณีที่เกิดข้อผิดพลาด ช่องทาง Omni สําหรับ Customer Service จะไม่ลองใหม่ และจะแสดงข้อความแสดงข้อผิดพลาดตามรหัสข้อผิดพลาดที่ให้ไว้แทน
  • ในกรณีที่การตอบกลับที่ส่งคืนไม่ถูกต้องหรือไม่สมบูรณ์ ข้อความแสดงข้อผิดพลาดบนแบนเนอร์การแปลจะปรากฏในตัวควบคุมการสนทนา
  • ถ้าไม่ได้ใช้วิธีการนี้ แล้วข้อความจะไม่ถูกแปล และข้อความแสดงข้อผิดพลาดต่อไปนี้จะแสดงต่อตัวแทน

translate ข้อความแสดงข้อผิดพลาด

เพิ่มทรัพยากรบนเว็บสําหรับการแปลแบบเรียลไทม์