Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I see a Trello user converting from "ghost" to "normal" via the API?

Our company uses the Trello API to add new users to our organization as part of our onboarding process. We add a user by making a PUT to /1/organizations/orgId/members, which returns a JSON representation of the new user:

{
    "id": "521baf66783e22e12f000040",
    "confirmed": false,
    "fullName": "Bradley Buda",
    "memberType": "ghost",
    "username": "bradleybuda4",
    "email": "[email protected]",
}

(some fields anonymized / removed)

We want to store ID of this user in our system for bookkeeping purposes (so we can later remove the account when we terminate Bradley). However, when the "ghost" user actually joins the organization (by clicking the link in the invite email), this user record is replaced by an entirely new one, with a different "id":

{
    "id": "521bb6b018c2a109450001d7",
    "confirmed": true,
    "fullName": "Bradley Buda",
    "memberType": "normal",
    "username": "bradleybuda4"
}

The email address is not returned in the GET /1/organizations/orgId/members call either, so we can't use that as a primary key. We could use the "username" to track our Trello users, but if the user accepts the invitation using an existing Trello account (rather than creating a new account) then the username will change as well.

Is there any durable way to track invitation acceptance for API-created users? Right now we have to manually keep track of Trello accounts after the invitation is accepted, and we'd like this process to be fully automated. I looked at the GET /1/organizations/orgId/memberships API as well, but those IDs (idMembership) also seem to change when the ghost user goes away. And as far as I can tell there aren't any webhooks that fire when the ghost user disappears.

like image 785
Brad Avatar asked Aug 26 '13 21:08

Brad


1 Answers

Your analysis is correct, as far as I can tell. There isn't really a way to track members accepting invitations like you want.

If you're willing to poll the memberships on that organization reasonably frequently (depending on how often you add new employees), then you can correlate each ghost disappearing with the member that appeared at the same time.

like image 72
Aaron Dufour Avatar answered Sep 21 '22 17:09

Aaron Dufour