Forum Discussion

tapatalk's avatar
tapatalk
Helper
12 years ago

I have some questions during my development work on the rest api,anybody can help me?

Hi,Lithium Team:

I have some questions during my development work on the rest api,anybody can help me?

 

1.How to get topics and count in a board without top topics?


2.How to get topics and count in a board with only top topics?


3.Some method looks working not correctly,for example:the threads/top method of Board,it returns the all threads in the board(include top and not top threads),the example api url:
http://tapatalk.demo.lithium.com/tapatalk/restapi/vc/boards/id/testboard1/threads/top


4.Maybe need more detail search feature description for implementing the question 1 and 2 requirements?The description about search feature in handbook is not detail and clear enough.


5.How to add thread view num?


6.How to mark thread as read instead of someone message of the thread?

 

7.Is there any way to know whether the site rest api is enabled through rest api?

3 Replies

  • YuriK's avatar
    YuriK
    Khoros Expert
    12 years ago
    Hey tapatalk,

    For questions 1-4: "top" currently just handles sorting (it sorts the threads based on how many kudos the topic message received), it doesn't do filtering of any kind. How do you expect the threads to be filtered when you say "top topics"?

    5. Number of views only apply to messages, not threads. Do you want to increment the number of views on a message?

    6. A thread is "read" when all the messages within it are read. You would have to iterate over the messages within the thread and mark them as read.

    7. You can just make a restapi call and you will get an error if it is disabled. You can make a call to /restapi/vc which will give you the community node

    Hope this helps,

    Yuri
  • tapatalk's avatar
    tapatalk
    Helper
    12 years ago

    YuriK wrote:
    Hey tapatalk,

    For questions 1-4: "top" currently just handles sorting (it sorts the threads based on how many kudos the topic message received), it doesn't do filtering of any kind. How do you expect the threads to be filtered when you say "top topics"?

    5. Number of views only apply to messages, not threads. Do you want to increment the number of views on a message?

    6. A thread is "read" when all the messages within it are read. You would have to iterate over the messages within the thread and mark them as read.

    7. You can just make a restapi call and you will get an error if it is disabled. You can make a call to /restapi/vc which will give you the community node

    Hope this helps,

    Yuri

     

    Hi Yuri:

    Thank you for your reply!:)

    5.Do I have to iterate over the messages within the thread and add them view num one by one when open a thread?

     

    7.I need a way to judge whether the rest api is enabled for caller,when I set Make REST API calls with read access and Make REST API calls with modify access options to DENY on site backend the /restapi/vc method still can work,so this can not help us anymore.Do you have other ideas for this?

     

     

     

  • YuriK's avatar
    YuriK
    Khoros Expert
    12 years ago
    Hey tapatalk,

    5. I'm not sure I follow, can you explain what you are trying to do?

    7. This depends on how you have your community set up. If you do permissioning using roles, you can use the /restapi/vc/users/id/[user_id]/roles call to get the roles that the user has.

    Hope this helps.

    Yuri