undefined: graphdrives.NewInvitePostRequestBody (Graph SDK Golang)

Sidi_244 0 Reputation points
2024-11-19T07:20:46.7566667+00:00

Hi There

I am trying to invite people to SharePoint Folders by using the example here (Golang): https://learn.microsoft.com/en-us/graph/api/driveitem-invite?view=graph-rest-1.0&tabs=go

However, NewInvitePostRequestBody seems to be inexisting. I also tried using the beta version: https://github.com/microsoftgraph/microsoft-graph-docs-contrib/blob/9211cc774a5747465e974f796f5a7ad3e0ecab0d/api-reference/beta/includes/snippets/go/send-sharing-invite-go-snippets.md?plain=1#L19

But it does not compile because of undefined: graphdrives.NewInvitePostRequestBody. Is anyone having the same issue and knows where the problem lies?

Thanks!

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,422 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,917 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Yakun Huang-MSFT 6,890 Reputation points Microsoft Vendor
    2024-11-19T08:05:37.64+00:00

    Hello Sidi_244,

    Thank you for reaching out to Microsoft Support!

    When you use the Graph SDK, this error appears to indicate that you have not installed the Graph Go SDK, please install it according to the documentation.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.


  2. Sidi_244 0 Reputation points
    2024-11-23T09:37:17.2+00:00

    The answer was to use

    graphdrives.NewItemItemsItemInvitePostRequestBody()
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.