Outlook 365 API를 사용하여 이메일에 답장을 보내려고합니다. 다음은 this tutorial입니다. 튜토리얼에 따라 우리가 입력 Commnet
필요 ReplyAll 이에 나는 그것이 Bad Request
오류를주고 그렇게 할 때 - 나는 방법을 아래에이 작업을 수행하려고Outlook 365 API에 대한 POST 요청을 ReplyAll에 보내는 방법
"error": {
"code": "ErrorInvalidRecipients",
"message": "At least one recipient isn't valid., A message can't be sent because it contains no recipients."
}
.
public string EmailReplyAll(AuthenticationResult result, string uriString, string msgBody)
{
HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, uriString);
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", result.AccessToken);
EmailReplyAll replyAll = new EmailReplyAll();
replyAll.MsgBody = msgBody;
var jsonData = JsonConvert.SerializeObject(msgBody);
var content = new StringContent(jsonData, Encoding.UTF8, "application/json");
HttpResponseMessage response = httpClient.PostAsync(request.ToString(),content).Result;
if (!response.IsSuccessStatusCode)
throw new WebException(response.StatusCode.ToString() + ": " + response.ReasonPhrase);
uriString = response.Content.ReadAsStringAsync().Result;
return uriString;
}
누군가 내가 잘못하고있는 부분을 지적 할 수 있습니까? 나는 WPF로 이것을 시도하고있다.
uriString의 값은 무엇입니까? –
https://outlook.office.com/api/v2.0/me/messages/{message_id}/replyall –
{message_id}을 올바르게 전달하는지 확인하시기 바랍니다. 귀하의 오류는 귀하가 게시하는 message_id에서 오는 것이라고 생각되는 수신자가 누락되었음을 보여줍니다. –