Forum Discussion

scottalvis's avatar
scottalvis
Contributor
13 years ago

REST API "/posts" and "/posts/style/all/count"

I'm trying to pull all posts from a given user. The "/posts/style/all/count" API call is return 51 yet the "/posts/latest/index" only returns message up to index 48. It appear the count is off by 2. I understand it a zero based index so if the total count is 51 the indexes should be 0 - 50.

 

What am I missing?

 

Thank you,

 

Scott

3 Replies

  • JeffS's avatar
    JeffS
    Lithium Alumni (Retired)
    13 years ago

    Hi Scott,

     

    Out of curiosity, are you performing this call anonymously or with a standard user account that is used for rest api? If so, some posts may be hidden if the user had made a post in a private area or had one of their posts moved to a deleted posts board (or something of that nature). This may not be the case, but I thought I'd mention it. If not, please feel free to open up a support ticket (Support Category - select the Cases tab) and we can retrieve further information and investigate what the problem might be.

     

    Regards,

  • scottalvis's avatar
    scottalvis
    Contributor
    13 years ago
    I'm making the API calls from a custom component. When calling from a custom component do I need a special user?
  • VenkS's avatar
    VenkS
    Lithium Alumni (Retired)
    12 years ago

    If you would like to make the REST API call with all the permissions, you may use the "restadmin" object instead of the "rest" object. Please keep in mind that this makes the REST call with admin privileges, so be careful about the calls being made, so as not to open up your community to security vulnerabilities.

     

    Hope that helps!