Independentsoft
Any library, any programming language
Home
Purchase
Support
Company
Contact
JGraph
>
Tutorial
> Update channel
The following example shows you how to update a team channel.
import java.util.List; import com.independentsoft.graph.GraphClient; import com.independentsoft.graph.GraphException; import com.independentsoft.graph.teams.Channel; public class Test { public static void main(String[] args) { try { GraphClient client = new GraphClient(); client.setClientId("63333333-209e-454e-b7bd-55a4d201270f"); client.setTenant("independentsoft.onmicrosoft.com"); client.setClientSecret("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); String teamId = "123456-e48c-4569-a3b0-639cce67fdfc"; List
channels = client.getChannels(teamId); for (Channel channel : channels) { if (channel.getDisplayName().equals("Test Channel")) { Channel updateChannel = new Channel(); updateChannel.setId(channel.getId()); updateChannel.setDisplayName("Updated Channel"); updateChannel.setDescription("Updated channel description"); client.updateChannel(teamId, updateChannel); System.out.println("Channel updated."); } } } catch (GraphException e) { System.out.println(e.getCode()); System.out.println(e.getMessage()); } } }
Need help? Ask our developers:
Name*
Email*
Message*