ChatterService.ChatterRestService.Unfollow C# (CSharp) Method

Unfollow() public method

public Unfollow ( string viewerId, string ownerId ) : ChatterResponse
viewerId string
ownerId string
return ChatterResponse
        public ChatterResponse Unfollow(string viewerId, string ownerId)
        {
            // find the subscription for this relationship and then delete it
            ChatterResponse cresp = GetFollowing(viewerId);
            while (cresp != null && cresp.following != null)
            {
                foreach (ChatterSubscription csub in cresp.following)
                {
                    if (csub.subject.id.StartsWith(ownerId))
                    {
                        return MakeRestCall("subscriptions/" + csub.id, Method.DELETE, null);
                    }
                }
                cresp = GetNextPage(cresp);
            }

            return cresp;
        }

Usage Example

 public void TestRestUnfollow()
 {
     ChatterService.ChatterRestService service = new ChatterService.ChatterRestService(_url, _logService);
     service.Login(_client_id, _grant_type, _client_secret, _username, _password);
     service.Unfollow("005A0000001X3Nb", "005A0000001X3gUIAS");
 }
All Usage Examples Of ChatterService.ChatterRestService::Unfollow