Forum Discussion

kc's avatar
kc
Ace
12 years ago

How can I add messages to generic node

I've a chat node like this (http://nerd.com/restapi/vc/nodes/type/key/chat/id/MyNerdySandBox). I want to see if I can allow member to add message to the node. When I try to get (http://nerd.com/restapi/vc/nodes/type/key/chat/id/MyNerdySandBox/messages).

 

 

I get this:

 

<response status="error">
<error code="504">
<message>
Method 'get' is not supported off of node 'generic_node.messages'.
</message>
</error>
</response>
 
Essentially, my goal is to allow member to add open-ended text to a chat node that I don't need that to be displayed anywhere. I only need to be able to programmatically read those submission back. I don't care they're messages, ideas, or comments as long as multiple members can submit multiple entries.
 
thanks.

1 Reply

  • DougS's avatar
    DougS
    Khoros Oracle
    12 years ago
    The Lithium API does not support posting messages via the generic "node" calls. You need to use the /boards/id/<board id>/messages/post call to post a message (only boards can contain messages, chats cannot). There is not a /messages/post/allowed call either (I would like there to be one), so you either need to set up a board ahead of time so any registered user can post, or else you need to try making the post and react in some way if the post /fails. You could also set up a board so that anyone who can view the board can post messages to it, then use the /nodes/type/key/board/id/<board id>/view/allowed call to see if the user can view the board.