Forum Discussion
adriana4u
3 years agoMaven
Hello,
Sorry for the delay. I have tried to do a subscription but the following message appeared
{
"status": "error",
"message": "An unexpected error occurred.",
"data": {
"type": "error_data",
"code": 301,
"developer_message": "",
"more_info": ""
},
"metadata": {}
}
In attachment is how I did it in postman.
Where can I edit to add an example like below:
{
"data":{ "type":"subscription", "target":{ "type":"label", "id":"Mexico" }, "board":{ "id":"vacationBlog" } } }
VikasB
3 years agoBoss
I am able to do it successfully. You need to pass this JSON object in request body in raw form. For board subscription, object should be like this
{
"data":{
"type":"subscription",
"target":{
"type":"board",
"id":"BOARD_ID"
}
}
}
I have added a screenshot for your reference.
Here are the steps -
- Get session key using authentication API
https://community.khoros.com/restapi/vc/authentication/sessions/login?user.login=Username&user.password=Password&restapi.response_format=json
user.login - Admin username
user.password- Admin Password - Get actual user's session key using actual user's username and admin's session key
https://community.khoros.com/restapi/vc/authentication/sessions/login?restapi.session_key=i1O_ERGqWxBcof7lKdUwR9Z4O8o8bzjZL8-8aLCSuDo.&user.login=test_user
restapi.session_key - session key received from step 1
user.login - username to whom you want to subscribe to the board - Use below API to add a board subscriber
https://community.khoros.com/api/2.0/subscriptions?restapi.session_key=M8hO5OObWijVUpD4lkdBP84YNMJnZW3XBmRX4KYT_vI.
restapi.session_key - session key received in step 2
Pass json object like below in Postman under request body > raw{"data":{"type":"subscription","target":{"type":"board","id":"lithium_test1"}}}
Related Content
- 6 years ago
- 4 months ago