Home

GET latest channel messages and replies

%3CLINGO-SUB%20id%3D%22lingo-sub-254055%22%20slang%3D%22en-US%22%3EGET%20latest%20channel%20messages%20and%20replies%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-254055%22%20slang%3D%22en-US%22%3E%3CP%3EIs%20there%20a%20way%20to%20query%20the%20ChatChannel%20messages%20and%2For%20replies%20endpoint%20for%20the%20latest%20posts%3F%26nbsp%3B%20I%20tried%20odata%20filters%20but%20am%20unsuccessful.%26nbsp%3B%20For%20example%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fbeta%2Fteams%2F%3CID%3E%2Fchannels%2F%3CID%3E%2Fmessages%3F%24filter%3DcreatedDateTime%2FdateTime%3C%2FID%3E%3C%2FID%3E%3C%2FA%3Ege%20'2017-07-01T08%3A00'%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fgraph.microsoft.com%2Fbeta%2Fteams%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fbeta%2Fteams%2F%3C%2FA%3E%3C%2FSPAN%3E%3CSPAN%3E%3CID%3E%3C%2FID%3E%3C%2FSPAN%3E%3CSPAN%3E%2Fchannels%2F%3CID%3E%2Fmessages%3F%3C%2FID%3E%3C%2FSPAN%3E%3CSPAN%3E%24orderby%3DcreatedDateTime%20desc%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThe%20response%20is%3A%20The%20query%20specified%20in%20the%20URI%20is%20not%20valid.%20Query%20option%20'OrderBy'%20is%20not%20allowed%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EHow%20do%20I%20get%20the%20most%20recent%20messages%20and%20replies%20or%20those%20from%20let%20say%20yesterday%3F%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-254055%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EHow-to%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
André Bédard
New Contributor

Is there a way to query the ChatChannel messages and/or replies endpoint for the latest posts?  I tried odata filters but am unsuccessful.  For example:

 

https://graph.microsoft.com/beta/teams/<id>/channels/<id>/messages?$filter=createdDateTime/dateTime ge '2017-07-01T08:00'

 

https://graph.microsoft.com/beta/teams/<id>/channels/<id>/messages?$orderby=createdDateTime desc

 

The response is: The query specified in the URI is not valid. Query option 'OrderBy' is not allowed

 

How do I get the most recent messages and replies or those from let say yesterday?