Forum Discussion

nrajesh's avatar
nrajesh
Guide
8 years ago

Reply Message - REST API

Hi,
I tried below given 2 methods for REPLY to the message, but none of these working. Anyone help me out from this, i have missed anything or another ways are there to REPLY to the message in the board.

 

This method is creating new message not replying to the mentioned parent.

Method : POST
URL : https://api.stage.lithium.com/community/2.0/tenant_id/messages
Headers : Content-Type - application/json
client-id - JJHJHKJHKHJKLJLJLKJKJLJKJJLJL=
Authorization - Bearer HJHJHJHJHJHJHJHJHJJH=
Data :
{
"data": {
"type": "message",
"subject": "hello world",
"body": "this is a message post.",
"board": {
"id": "kzkzkzkzkzkz"
},
"parent":"123456"
}
}

 

This method is throwing error.
Method : POST
URL : http://community_name/restapi/vc/messages/id/123456/reply
Headers : Content-Type - application/json
client-id - JJHJHKJHKHJKLJLJLKJKJLJKJJLJL=
Authorization - Bearer HJHJHJHJHJHJHJHJHJJH=
Data : 
{
"data": {
"type": "message",
"subject": "hello world",
"body": "this is a message post.",
"board": {
"id": "kzkzkzkzkzkz"
}
}

 

Reponse:

Unauthorized

This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.