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
  • Hello 

    The endpoint that you shared works if you want to remove a user from a Team. 

    For example, if I need to remove Sally( id:seed_sally_id) from the West (id:West) team my endpoint would look like this: 

    DELETE: mysugarurl/rest/v11/Teams/West/link/users/seed_sally_id

    If what you are trying to accomplish is to remove a team from a given record, the best is to replicate what Sugar does in GUI.

    Instead of deleting you will be Updating the record with the new Teams.


    As an example if you want to update an Opportunity keeping only the West team the Endpoint will look like this: 

    PUT: mysugarurl/rest/v11/Opportunities/43f1c38e-1e0c-11ed-a55a-02a5a97c2d5e

    Body: {"team_name":[{"id":"West","name":"West","name_2":"","primary":true,"selected":false}]}

     

    I hope this helps. 

    André

     

Reply
  • Hello 

    The endpoint that you shared works if you want to remove a user from a Team. 

    For example, if I need to remove Sally( id:seed_sally_id) from the West (id:West) team my endpoint would look like this: 

    DELETE: mysugarurl/rest/v11/Teams/West/link/users/seed_sally_id

    If what you are trying to accomplish is to remove a team from a given record, the best is to replicate what Sugar does in GUI.

    Instead of deleting you will be Updating the record with the new Teams.


    As an example if you want to update an Opportunity keeping only the West team the Endpoint will look like this: 

    PUT: mysugarurl/rest/v11/Opportunities/43f1c38e-1e0c-11ed-a55a-02a5a97c2d5e

    Body: {"team_name":[{"id":"West","name":"West","name_2":"","primary":true,"selected":false}]}

     

    I hope this helps. 

    André

     

Children