2014-10-16 2 views
0

오피스 365 API와 새로운 이벤트를 만들 수 없습니다 내가의 예에 따라 이벤트를 게시하려고 : http://msdn.microsoft.com/en-us/library/office/dn792114(v=office.15).aspx내가 사무실 365 API의 달력 REST를 사용하고

내가 얻을 응답은

입니다
{error: {code: "ErrorInvalidRequest" message: "Cannot read the request body."} } 

https://outlook.office365.com/ews/odata/Me/EventsContent-Type: application/json으로 Avanced Rest Client로 게시 할 때 office365 서비스 계정을 사용하고 있습니다. "@odata.type": "#Microsoft.Exchange.Services.OData.Model.Event"이 게시물은 성공 "Attendees"과 함께 제거 된 경우

json으로 I 포스트

{ 
 
    "@odata.type": "#Microsoft.Exchange.Services.OData.Model.Event", 
 
    "Subject": "Discuss the Calendar REST API", 
 
    "Body": { 
 
    "ContentType": "HTML", 
 
    "Content": "I think it will meet our requirements!" 
 
    }, 
 
    "Start": "2014-07-02T18:00:00Z", 
 
    "End": "2014-07-02T19:00:00Z", 
 
    "Location": { 
 
     "DisplayName": "Conference Room 1" 
 
    }, 
 
    "ShowAs": "Busy", 
 
    "Attendees": [ 
 
    { 
 
     "Name": "Alex Darrow", 
 
     "Address": "[email protected]", 
 
     "Type": "Required" 
 
    }, 
 
    { 
 
     "Name": "Anne Wallace", 
 
     "Address": "[email protected]", 
 
     "Type": "Optional" 
 
    }, 
 
    { 
 
     "Name": "Conference Room 1", 
 
     "Address": "[email protected]", 
 
     "Type": "Resource" 
 
    } 
 
    ] 
 
}

위의 링크의 예에서 복사됩니다.

누구든지 도와 주시면 많은 도움을받을 수 있습니다.

답변

1

메일을 보내 주셔서 감사 드리며 불편을 끼쳐 드려 죄송합니다. 다음은 작동해야하는 요청의 수정 된 버전입니다. 저는 두 가지 변화를했습니다. 참석자 목록에 이제 EmailAddress라는 유형이 포함됩니다. 또한 @ odata.type을 생략해야하므로 포함시키지 않아도되고 컬렉션에 게시 할 것이기 때문에 유형이 Google 서비스에 의해 추론됩니다. Mail, Calendar 및 Contacts의 네임 스페이스가 "# Microsoft.Exchange.Services.OData.Model"에서 "# Microsoft.OutlookServices"로 업데이트되었으므로 @ odata.type에서 오류를 반환하고 있습니다.

{ 
    "Subject": "Discuss the Calendar REST API", 
    "Body": { 
    "ContentType": "HTML", 
    "Content": "I think it will meet our requirements!" 
    }, 
    "Start": "2014-07-02T18:00:00Z", 
    "End": "2014-07-02T19:00:00Z", 
    "Location": { 
     "DisplayName": "Conference Room 1" 
    }, 
    "ShowAs": "Busy", 
    "Attendees": [ 
    { 
     "EmailAddress": { "Name": "Alex Darrow", "Address": "[email protected]" }, 
     "Type": "Required" 
    }, 
    { 
     "EmailAddress": { "Name": "Anne Wallace", "Address": "[email protected]"}, 
     "Type": "Optional" 
    }, 
    { 
     "EmailAddress": { "Name": "Conference Room 1", "Address": "[email protected]" }, 
     "Type": "Resource" 
    } 
    ] 
} 

다음은 몇 가지 추가 컨텍스트입니다. Google은 현재 미리보기 사용자로부터받은 피드백에 따라 Mail, 캘린더 및 주소록 API에 대한 변경 사항을 적용하고 있습니다. 이러한 변경 사항 중 일부는 변경 사항을 위반하고 있으며 아직 버전 관리를 추가하지 않았으므로이 문제가 발생합니다. 버전 관리는 Office 365로 롤아웃되는 변경 사항의 일부이며 이전 버전과 호환되지 않는 변경은 버전 관리에서 문제가되지 않습니다. 가능한 한 빨리 문서 및 클라이언트 라이브러리를 업데이트하기 위해 노력하고 있습니다. 그동안 개발자에게 머리를 알려주기 위해 announcement을 게시했습니다.

질문이 있거나 더 많은 정보가 필요하면 알려주세요.

감사합니다,

벤 카트

+0

덕분에, 그것을 해결! – Malte

+0

안녕하세요. 이것은 나를 위해 작동하지 않습니다. 여전히 효과가 있습니까? 나는 아직도이 오류가 있습니다. http://stackoverflow.com/questions/28623878/errorinvalidrequest-while-using-post-request-in-office365 –

관련 문제