-
I'm able to retrieve them with the SDK calling import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
"github.com/microsoftgraph/msgraph-sdk-go/users"
)
func main() {
ctx := context.Background()
tokenCredential := "secret!"
client, err := msgraphsdk.NewGraphServiceClientWithCredentials(tokenCredential, nil)
if err != nil {
return nil, err
}
params := &users.ItemMailFoldersDeltaRequestBuilderGetRequestConfiguration{
QueryParameters: &users.ItemMailFoldersDeltaRequestBuilderGetQueryParameters{
// nextLink somewhere here ?
},
}
resp, err := client.Users().ByUserId(userID).MailFolders().Delta().Get(ctx, params)
if err != nil {
return nil, err
}
// How to use them
nextLink := resp.GetOdataNextLink()
deltaLink := resp.GetOdataDeltaLink()
} How do we use the My ultimate goal is to use |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 11 replies
-
Thanks for using the Go SDK and for reaching out. The Go SDK now provides a page iterator that'll go through the next links automatically for you. Once your application has enumerated all the current changes, it needs to store the delta link that'll be provided and call the API again at a later time. Unfortunately we haven't had time yet to document the use of the page iterator in our public docs (CC @jasonjoh ) but you can look at other languages for the time being to get a global understanding. (And maybe @rkodev can provide a snippet here). You should also have a look at the delta queries concept page to get a better understanding of how delta queries work in general on Microsoft Graph. |
Beta Was this translation helpful? Give feedback.
-
We do document this in our public docs at the link you provided! |
Beta Was this translation helpful? Give feedback.
I think there are multiple confusions in the last code example you've provided.
First off
is not a delta endpoint but just the regular list endpoint, it will never return a delta link and should be instead
(the request configuration and query parameters need to be updated accordingly)
Then, it's not
models.CreateMailFolderCollectionResponseFromDiscriminatorValue
that should be used for deserialization butusers.CreateItemMailFoldersDeltaResponseFromDiscriminatorValue
https://github.com/microsoftgraph/msgraph-sdk-go/blob/3280bd480cad4749ddd7c00a6310f74c3b3ce529/users/item_mail_…