2017-11-16 1 views
3

Microsoft Graph API를 사용하여 ASC/DESC의 두 방향으로 이벤트를 가져올 수 있어야합니다.시작 날짜별로 이벤트 정렬

: 또한

{ 
    "error": { 
     "code": "BadRequest", 
     "message": "The $orderby expression must evaluate to a single value of primitive type.", 
     "innerError": { 
      "request-id": "c00d676d-ef8e-418b-8561-80e08729da71", 
      "date": "2017-11-16T13:31:59" 
     } 
    } 
} 

, 내가 직접 날짜에 액세스하려고 : 나는 다음과 같은 오류가 요청을 수행 할 때, 그러나

https://graph.microsoft.com/v1.0/me/events?$orderby=start 

: 나는 그것을 달성하기 위해 다음과 같은 API를 시도하고있다

{ 
    "error": { 
     "code": "BadRequest", 
     "message": "The child type 'start.dateTime' in a cast was not an entity type. Casts can only be performed on entity types.", 
     "innerError": { 
      "request-id": "240342f5-d7f6-430b-9bd0-190dc3e1f73b", 
      "date": "2017-11-16T13:32:39" 
     } 
    } 
} 
:
https://graph.microsoft.com/v1.0/me/events?$orderby=start.dateTime 

다음과 같은 오류가있어 0

날짜별로 ASC/DESC 순서로 이벤트를 정렬하는 방법이 있습니까?

답변

3

아주 가까이에 있지만 DateTime을 잘못 참조하고 있습니다. 올바른 형식은 {parent}/{child}입니다. 다음과 같이 작동합니다.

https://graph.microsoft.com/v1.0/me/events?$orderby=start/dateTime 
https://graph.microsoft.com/v1.0/me/events?$orderby=start/dateTime desc 
+1

정확히 필요한 것입니다. 감사! – dvelopp

관련 문제