2017-11-16 6 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をしようとしています

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

は、次のエラーを得た:

{ 
    "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" 
     } 
    } 
} 

日付を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

関連する問題