How to remove a team via REST API?

Hi everyone.

I'm trying to remove a team via the Rest API but am having problems with doing so. As far as I can tell the "correct" endpoint would be https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_12.0/Integration/Web_Services/REST_API/Endpoints/modulerecordlinklink_nameremote_id_DELETE/.

However when trying the following:

URL/.../3b029990-4ed8-11ed-8fd3-00163ef40625

I'm getting 500 error with the logs showing:
PHP Recoverable fatal error:  Object of class Team could not be converted to string in /modules/Teams/TeamSetLink.php on line 294

Has anyone been able to remove teams via this API or could share any thoughts? I noticed the documenation around ACL roles and team_sets isn't great for the Rest API so  any help would be great.


Thanks,


Daniel

Parents Reply Children
  • Hi 

    When you remove a team via GUI, what Sugar is doing is replacing the team_set_id for that record.
    The new Team Set will have the team combination without the team you removed. 

    Therefore via API, the most straightforward approach would be

    1 - Retrieve the teams from the Account Record (West and East)

    2 - Process the team list to remove the teams you want to remove (Remove East)

    3 - Update the record with the reduced team list it was described before. (Update with team West)

    This will update the team set id with the new team list. 

    If you want to remove a given team from a team set, the only way that crosses my mind is to load the team's relationship to get the team_set_id and then use the remove()method. 
    But that needs to be done Programmatically as it is described here