Delete member from shift with API?

Not Yet Reviewed

I can add a member to a shift in a specific position but I don't see a way to delete a member from a shift.  I'm looking to do the following.  I have a 3 member shift that the position 2 and 3 will always remain the same.  Position 1 is the position that I would like to add a member to and delete the existing member.

Through the API I'm able to add a member to the position 1 spot in the shift but I don't see a way to delete the other person in position 1 to move them out of the shift.

We do this manually through the web interface twice a day and I'd love a way to do it through the API.  Thoughts?

0

Comments

4 comments
Date Votes

Please sign in to leave a comment.

  • I also do not see any API endpoints that would allow us to remove a specific member from a shift. So at least for now, it seems like you'd have to make a few extra API calls to accomplish your goal:

    1. Delete the existing shift
    2. Create a new shift with the same name
    3. Add the variable member to shift position 1
    4. Add the constant members to shift positions 2 & 3


    I assume this would be scripted with only #3 changing based on the person that is to be on-call, so I expect it would happen quickly enough that you wouldn't notice the extra calls involved. It isn't elegant or efficient, but I imagine it would accomplish what you want.

    0
  • Matt and Sean,

    You are correct that the API does not yet have a "delete" a shift member endpoint, although that is certainly in our plans to be added.  In the meantime, there are multiple ways to accomplish your goal - Sean described one option.  Another approach would be to create a second Group with a single 24 hour shift, which I'll call Group B.  You would replace the User that is in position 1 of your primary Group with "Group B".  You can then use the existing API to to delete the 24 hour shift in Group B, and re-add it with just a single user. 

    This accomplishes the same result, but would simplify the logic required to make this change.  When the API does support the "delete" functionality, you could replace this code with a more direct change approach.

      

    0
  • Sorry to bring up this old topic...
    Any news regarding this?
    It seems so obvious that you add a member and also can remove a member automaticly. 

    For us it will make the difference of automating our roster or not.

    0
  • Is this functionality on the roadmap anywhere?  I would be interested in this being supported directly via the API.

    0

Didn't find what you were looking for?

New post