translateMessage

Dynamics 365 के लिए ग्राहक सेवा के लिए ओमनीचैनल एक शक्तिशाली अनुप्रयोग है, जो Dynamics 365 Customer Service Enterprise की शक्ति का विस्तार करता है ताकि संगठनों को डिजिटल मैसेजिंग चैनलों में अपने ग्राहकों के साथ तुरंत जुड़ने और संलग्न करने में सक्षम बनाया जा सके। Customer Service के लिए ओमनीचैनल तक पहुँचने के लिए एक अतिरिक्त लाइसेंस की आवश्यकता होती है। अधिक जानकारी के लिए, Dynamics 365 Customer Service मूल्य निर्धारण अवलोकन और Dynamics 365 Customer Service मूल्य निर्धारण योजना पृष्ठ देखें।

इस विधि को वेब संसाधन में लागू करने की आवश्यकता है। इस विधि को ग्राहक और एजेंट के बीच आदान-प्रदान किए गए प्रत्येक वार्तालाप संदेश के लिए कहा जाता है, यदि अनुवाद चालू है और यदि संदेश का गंतव्य भाषा के लिए बातचीत में पहले अनुवाद नहीं किया गया है।

महत्त्वपूर्ण

API को कार्यान्वित करने के तरीके के बारे में अधिक जानकारी के लिए यह translateMessage देखें.

सिंटैक्स

function (conversationId, translationConfig): Object

पैरामीटर्स

नाम प्रकार वर्णन
translationConfig JavaScript ऑब्जेक्ट , और conversationId कुंजी-मूल्य जोड़े से मिलकर बनता messagePayloadtranslateToC1orC2 है।

यहाँ पैरामीटर की 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 करता है।

इंटरफ़ेस ऑब्जेक्ट

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 पैरामीटर 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 destinationLanguageTranslatedMessageResponse पैरामीटर एक लोकेल आईडी का प्रतिनिधित्व करता है। अधिक जानकारी: स्थानीय ID.

नमूना प्रतिक्रिया

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

नोट

  • इस पद्धति के निष्पादन के दौरान अपवाद की स्थिति में, Omnichannel for Customer Service पुनः प्रयास नहीं करेगा और इसके बजाय अनुवाद विफल त्रुटि संदेश प्रदर्शित करेगा.
  • इस विधि को निष्पादित करते समय त्रुटि के माध्यम से errorObjectसूचित किया जा सकता है। किसी त्रुटि के मामले में, Omnichannel for Customer Service पुनः प्रयास नहीं करेगा और इसके बजाय प्रदान किए गए त्रुटि कोड के आधार पर त्रुटि संदेश प्रदर्शित करेगा।
  • यदि लौटाई गई प्रतिक्रिया अमान्य या अधूरी है, तो अनुवाद बैनर पर एक त्रुटि संदेश वार्तालाप नियंत्रण में दिखाई देगा।
  • यदि यह विधि लागू नहीं की गई है, तो संदेश का अनुवाद नहीं किया जाएगा और एजेंट को निम्न त्रुटि संदेश प्रदर्शित किया जाएगा।

translateMessage त्रुटि संदेश।

रीयल-टाइम अनुवाद के लिए एक वेब संसाधन जोड़ें