Forum Discussion

tripp-bishop's avatar
12 years ago

Getting message subscription info for post via REST

We have a custom UI for creating forum posts and we're using the an endpoint to create/edit these posts. We're just using the standard messages/id/edit and /boards/id/my-board-id/messages/post calls to make this happen. We have a checkbox that allows the user to subscribe to the thread via the message.subscribe_type=thread parameter in the URL (just like the "email me when someone replies" in the form I'm using here).

 

My qusetion is, once we set this value (we're setting it to "thread" right now), how do we later retrieve that fact? This is of particular interest when the user is editing the post via the custom UI. We need to know whether or not to set the checkbox to checked or not. The only call I see in the API is /messages/id/${message_id}/subscriptions/users/self/type/email, but that's not returning anything for my message. Is there some other call I need to make to find this info?

 

Cheers,

 

Tripp

  • AdamN's avatar
    AdamN
    12 years ago

    The types for a subscription are: bookmark, float, email. So that could be why your call is failing.

     

    If you're subscribing the user to the thread instead of an individual message, try getting a ThreadSubscriptionContext instead:

    /restapi/vc/threads/id/83400/subscriptions

     For example:

    /restapi/vc/threads/id/83400/subscriptions/users/self/type/email

     

     

    • I get the following response when I try /messages/id/${message_id}/subscriptions/users/self/type/thread:

       

       

          <response status="error"><error code="502"><message>
            Invalid path element.
          </message></error></response>

       

      I also tried /messages/id/${message_id}/subscriptions/global/type/thread which generates the same response:

       


          <response status="error"><error code="502"><message>
            Invalid path element.
          </message></error></response>

      • AdamN's avatar
        AdamN
        Khoros Oracle

        The types for a subscription are: bookmark, float, email. So that could be why your call is failing.

         

        If you're subscribing the user to the thread instead of an individual message, try getting a ThreadSubscriptionContext instead:

        /restapi/vc/threads/id/83400/subscriptions

         For example:

        /restapi/vc/threads/id/83400/subscriptions/users/self/type/email