Home Forums BP Better Messages API insert message in chat

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #11841

    Was wondering if somebody has example of posting message in a specific chat? I like to insert ads now and than to get funding for the websocket license.
    Understand that it should support the buddypress messaging api, anyone got example? preferably in C# but any language will do. Highly appreciated.

    Private Messaging


    Hi there!

    This is great example how to send messages with function:

    How to add welcome message for new users?



    Again stunned by your support however how to put this message in a specific chat window? should i use thread id for that or something?



    ok, short update, due to other priorities put this on hold for a while. Via the endpoints from buddypress managed to add ads to the group chats every so many seconds. works great. its still pretty unclear to me what the user_id, thread_id, etc actually mean for better messages, can’t seem to confirm it has something to do with which chatroom, just cant get my finger behind it, can you confirm what the parameters mean in context of better messages?

    Current code works but really rough

    Message p = new Message
    recipients = 1,
    sender_id = item.UserId, //, //1
    Id = 1, // 1, // user id??
    thread_id = 0, //??
    message = HTMLTools.CreateChatImgTag(Media.Url, “”)

    var Chats = await wpclient.CustomRequest.UpdateAsync<Message, dynamic>(“buddypress/v1/messages”, p);

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.