octokit / octokit.net

A GitHub API client library for .NET
https://octokitnet.readthedocs.io/en/latest/
MIT License
2.67k stars 1.07k forks source link

[FEAT]: Invitation email to an organisation has been accepted #2954

Open Robert-Wright-NTT opened 1 month ago

Robert-Wright-NTT commented 1 month ago

Describe the need

When an user receives an email invite to join an Organisation; is there a way to check that they've joined the organisation. The reason for this is that I'd like to add that user as a member in my database once they've accepted the invite and are actually a member of the organisation.

SDK Version

Octokit v13.0.1

API Version

No response

Relevant log output

No response

Code of Conduct

nickfloyd commented 1 month ago

Hey @Robert-Wright-NTT thanks for reaching out.

So I think what you're looking for is the org pending invite endpoints from the GitHub REST API.

This functionality is present in both Octokit.net and our Generated dotnet-sdk

For Octokit.net you could use the following API:

For the new Generated SDK you could use:

I hope that helps!

Robert-Wright-NTT commented 1 month ago

Hi Nick,

Thanks for getting back to me.

I'll make use of this endpoint; but what I was looking for was at the point that the user actually joins the organisation when they're redirected to the website for the organisation they're joining.

What I want to do is store the user in my database once they're joined the organisation. I can see pending invites as per the endpoint you supplied above. But at what point we I get notified that they've accepted the invite. I could store the user in my database with a status of Pending, but how will I know to change the status to Active?

Hope this makes sense

Many thanks Robert