Skip to content

How to use @odata.nextLink in graph client sdk to get the next set of messages. #415

@MN-Dheeraj

Description

@MN-Dheeraj

I am using Graph client SDK (com.microsoft.graph.microsoft-graph:6.2.1) to read all messages in a channel.

Here is my code.
ChatMessageCollectionResponse result = getGraphClient().teams().byTeamId(teamsId).channels()
.byChannelId(channelId).messages().get(rc -> {
rc.queryParameters.top= 50;
rc.queryParameters.skip= 0;
});
chatMessages = result.getValue();

I know that I get only 50 records. But, I need to use @odata.nextLink somehow to make call to get next set of messages as well.
I don't want to take @odata.nextLink and make a rest call manually as I will need token again manually.
Is there a way I can modify my code to make multiple calls using different url every time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions