Independentsoft
Professional software libraries for developers
Home
Purchase
Support
Company
Contact
Graph C++
>
Tutorial
> Create channel
The following example shows a request to create a standard channel.
C++ example
#include
#include "independentsoft/graph/graph_client.hpp" #include "independentsoft/graph/graph_exception.hpp" #include "independentsoft/graph/teams/channel.hpp" using namespace independentsoft::graph; using namespace independentsoft::graph::teams; int main() { try { GraphClient client; client.client_id = "63333333-209e-454e-b7bd-55a4d201270f"; client.tenant = "independentsoft.onmicrosoft.com"; client.username = "info@independentsoft.onmicrosoft.com"; client.password = "password"; Channel channel; channel.display_name = "Discussion"; channel.description = "This channel is where we debate all future plans"; Channel createdChannel = sync_wait(client.create_channel("b030d33a-ffdc-4dae-80d7-123456", channel)); std::cout << "Id: " << createdChannel.id << std::endl; } catch (const GraphException& ex) { std::cout << "Error: " << ex.code << std::endl; std::cout << "Message: " << ex.message << std::endl; } return 0; }
Need help? Ask our developers:
Name*
Email*
Message*