This is a method that allows you to add a smart replies belonging to your company by making a request with the received Token. In the body in json format, “Pattern” (Pattern), “Answer” (Answer), “IsActive” (Is it active), “MatchCase” (Case sensitivity), “MatchWholeWord” (Compare the whole word) and “UseRegularExp” You have to make a request with parameters.
Authorization header should be entered as “token_type” value, space character, “Access_token” value returned as a result of token request.

As a result of the request, a message that the registration has been made is received. When you make a request to the “GetAllSmartReplies” method, you can see the record of the smart reply you added.

private static IRestResponse InsertAPISmartReply()
{
RestClient client = new RestClient("https://api.flexxii.com/");
RestRequest request = new RestRequest("api/SmartReplies/InsertAPISmartReply", Method.POST);
request.AddHeader("Content-Type", "application/json; charset=utf-8");
request.AddHeader("Authorization", content_type + " " + access_token);
request.AddJsonBody(new { "Pattern"": "string", ""Answer": "string","Media": "string","IsActive": true,"MatchCase": true,"MatchWholeWord": true,"UseRegularExp": true });
IRestResponse response = client.Execute(request);
return response;
}
Was this helpful?
0 / 0