Forum Discussion

KateM's avatar
KateM
Lithium Alumni (Retired)
13 years ago

Float a post in bulk via API?

A customer wants to know if they can use our API to run a script (or batch process) on their newly migrated data in production so that all posts with a certain attribute are floated to the top of their respective boards.

1 Reply

  • AdamN's avatar
    AdamN
    Khoros Oracle
    13 years ago

    There's not a single REST API call to support this use case, but it could be done as a two step process assuming that the REST API supports getting the messages by the "certain attribute" you had in mind.

     

    First you'd make a REST API call to get your list of messages meeting the critera you desired. Then for each of those messages, you could obtain a MessageSubscriptionContext object and use the "global/add" method. This method accepts a parameter named "subscription.type" for which you'll want to specify the value "float". For example, the REST API call might look like this for a single message:

     

    /restapi/vc/messages/id/1271/subscriptions/global/add?subscription.type=float