Get more that 100 recent solutions

Hi everyone!

 

I'm trying to get a list of all the posts that were marked as solved in the past year. Right now I'm using API v1:

 

 

/solutions/recent?page_size=${pageSize?number}&page=${currentPage?number}&date_end=${endDate}&date_start=${startDate}

But I noticed it always returns the first 100 threads. Even if I use this

 

 

/solutions/recent?page_size=1000

I only get 100 solutions. Even if the solution count for the community is higher.

 

 

 

It sounds like the 'recent solution' list is only 100 thread long by desing, but the documentation doesn't mention a limit: https://community.lithium.com/t5/Developer-Documentation/bd-p/dev-doc-portal?section=commv1&leaf-id=...

 

Is there a way to override that limit?

 

Thanks

Message 1 of 5
4 REPLIES
Web Design
Web Development

Hi @fuenteso

 

You should be able to do this using API v2, you may need do a little more work but I've been able to specify how many solutions to return using LIQL by appending LIMIT 200 for example to the end of the query.

 

Example:

SELECT * FROM messages WHERE is_solution=true LIMIT 200

returns 200 results in JSON format.


Documentation on API v2 and the query in question can be found below:

One of the advantages of API v2 is its flexibility so you can specify only the fields you need to reduce overheads.

 

Robert
Lithium Certified Developer

Click the Kudos button below if you find my posts helpful. If I've answered your query please click the Mark Solution button to help others find the same answer.
Message 2 of 5

Hi @RobertT,

 

Thanks for the suggestion! The only problem with v2 is that we only have a few allowed constraints and sorting fields.

 

In this particular case I'm interesed on recent solutions (not necessarily recent replies that were marked as a solution) that are older than 3 days within the past year. This means I need to use the solution time as a constraint and a sorting field, and I can't do that with API v2.

Message 3 of 5
Highlighted
Web Design
Web Development

@fuenteso

 

Thinking about API v1, while you will only get 100 responses back on the initial call, it should paginate the results so you might be able to offset the results using for example by incrementing the page number you should see results offset from that position.

 

For example:

/solutions/recent?page_size=100&page=1&date_end=${endDate}&date_start=${startDate}

Will give results 1-100, however

/solutions/recent?page_size=100&page=2&date_end=${endDate}&date_start=${startDate}

Will give results 101-200.

 

 

Unfortunately it means multiple API calls.

 

 

Robert
Lithium Certified Developer

Click the Kudos button below if you find my posts helpful. If I've answered your query please click the Mark Solution button to help others find the same answer.
Message 4 of 5

Hi,

 

Following up on this. The 100 thread cap is a setting that the Support team can change, all I had to do was contact them and ask them to change it.

 

Thanks for all the sugestions anyways!

Message 5 of 5