microsoftgraph / msgraph-sdk-go

Microsoft Graph SDK for Go
https://docs.microsoft.com/en-us/graph/sdks/sdks-overview
MIT License
238 stars 36 forks source link

obtain deleted mail folders via gosdk delta call #586

Closed luigi-fast closed 8 months ago

luigi-fast commented 1 year ago

Hello, I need to obtain the delta of a user mail folders but I need to filter only deleted one. According to your api documentation, it can be achieve like this with a GET call: GET /me/mailfolders/{id}/messages/delta?changeType=deleted

I've tried it with postman and it works.

My question is: how can I do that with the gosdk? The only query parameter I can use is the ones we found is the users.ItemMailFoldersDeltaRequestBuilderGetQueryParameters

baywet commented 1 year ago

Hi @luigi-fast , Thanks for using the go SDK and for reporting this. @rkodev this query parameter is missing from the metadata. We should add an entry to the xslt to insert the missing query parameter. Irvine should be able to help you with this if you need more specific directions.

luigi-fast commented 1 year ago

Yes, I would appreciate a workaround while waiting for the update.

Thanks

luigi-fast commented 1 year ago

@irvinesunday I don't know if my last post was clear but I would like some advice to achieve what I want to obtain: delta of deleted mail folders with the gosdk. Maybe it would be possible for the moment with a raw url or something like that?

Thanks

knirb commented 11 months ago

This is a blocker for us in a client project. Would be greatly appreciated if this got some focus. Our only option at the moment is to convert this to the raw request, and not very pleasant.

You should also probably have a look at updating the docs. They are both incorrectly formatted and outdated:

https://learn.microsoft.com/en-us/graph/delta-query-events?view=graph-rest-1.0&tabs=go#step-2-sample-second-request

luigi-fast commented 8 months ago

I'm still waiting for a workaround. Nothing to say about our problem?

rkodev commented 8 months ago

@luigi-fast Thanks for your patience, This issue should be fixed in the latest version v1.32.0 of this sdk. Please confirm this code works


    changeType := "deleted"
    configuration := &users.ItemMailFoldersItemMessagesDeltaRequestBuilderGetRequestConfiguration{
        QueryParameters: &users.ItemMailFoldersItemMessagesDeltaRequestBuilderGetQueryParameters{
            ChangeType: &changeType,
        },
    }
    response, err := client.Me().MailFolders().ByMailFolderId("inbox").Messages().Delta().Get(context.Background(), configuration)
microsoft-github-policy-service[bot] commented 8 months ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

luigi-fast commented 8 months ago

@rkodev Sorry for the delay. I've tried it and it works well. Thanks.