Forum Discussion

pp_01's avatar
pp_01
Mentor
6 years ago

Adding custom metadata fields while creating a blog in the API.

Hey all.

Is there any way we can add a custom metadata field's value as a custom parameter while creating a blog in the API call for blog creation apart from the usual fields like message.subject, message.body etc.

Suppose this is the API call

/restapi/vc/blogs/id/${id}/messages/post?message.subject=' + subject + '&label.labels=' + labels + '&tag.add=' + tags + '&message.teaser=' + teaser

If I take the custom metadata's value in a variable is there any way to add it in the call and then use it later for displaying the content somewhere? 

If anyone knows anything about this then please let me know. Thanks in advance.

  • Hi pp_01 ,

    You can achieve this. You will just have to add another parameter in API with the custom metadata name and its value. For example : API - /restapi/vc/blogs/id/(blog board id)/messages/post?message.subject=test subject&(custom metadata name)=(custom metadata value)

    The above will create message and add the value to that corresponding message ID's custom metadata.

    Thanks

2 Replies

  • pp_01 
    By default, message post API will accept standard parameters only. You have to reach out to Khoros support If you want to add additional custom fields in message post API. 

  • Hi pp_01 ,

    You can achieve this. You will just have to add another parameter in API with the custom metadata name and its value. For example : API - /restapi/vc/blogs/id/(blog board id)/messages/post?message.subject=test subject&(custom metadata name)=(custom metadata value)

    The above will create message and add the value to that corresponding message ID's custom metadata.

    Thanks