Skip to main content
The First Step
March 4, 2024
Solved

Create Glip Team Message

  • March 4, 2024
  • 2 replies
  • 99 views

Hello, trying to find out how to create / post message in Glip using C# API.

Testing in sandbox (+16163285031). ClientID: WZMdfNElh7vc1Xv5k6NKDZ

Was able to create public team (ID 1928626182). But very unclear how to post a message to that team. The most I can see Create Note Request and Create Task Request. I tried to use create Note request, but nothing happened.

RestClient restClient = new RestClient(

_config.GetValue<string>("ClientID"),

_config.GetValue<string>("ClientSecret"),

_config.GetValue<string>("RingCentralServerURL"));

//Authenticate

await restClient.Authorize(_config.GetValue<string>("JWT"));

var bodyNote = new TMCreateNoteRequest { body = "AAA", title = "BBB" };

var resp2 = await restClient.TeamMessaging().V1().Chats("1928626182").Notes().Post(bodyNote);


    Best answer by PhongVu

    Here is the sample code to post a message to a chat

    static private async Task post_team_message(String chatId)
    {
        var bodyParams = new TMCreatePostRequest();
        bodyParams.text = "Send from C# app";
        var resp = await restClient.TeamMessaging().V1().Chats(chatId).Posts().Post(bodyParams);
    
        Console.WriteLine(JsonConvert.SerializeObject(resp));
    }

    2 replies

    PhongVu
    Community Manager
    PhongVuAnswer
    Community Manager
    March 4, 2024

    Here is the sample code to post a message to a chat

    static private async Task post_team_message(String chatId)
    {
        var bodyParams = new TMCreatePostRequest();
        bodyParams.text = "Send from C# app";
        var resp = await restClient.TeamMessaging().V1().Chats(chatId).Posts().Post(bodyParams);
    
        Console.WriteLine(JsonConvert.SerializeObject(resp));
    }
    The First Step
    March 5, 2024

    Thanks a lot.