'How to set multiple values in Slack cursor Parameter

In the Slack API End point URL, I used the cursor fields and I got all the public channels. But I am unable to set all the below curson values in the End point URL.

Could you please advise me how I can set these multiple cursor values in a parameter ""cursor ?

Please find below the End point URL :

req.setEndpoint('https://slack.com/api/conversations.list?limit=999&types=public_channel&exclude_archived=true&cursor=dGVhbTpDRjBDOUdWUk4=&cursor=dGVhbTpDMDFGMlFNR0g4Qw==&cursor=dGVhbTpDMDFTV0hOTDM0NA==');

Here is the cursor values :

dGVhbTpDRjBDOUdWUk4=

dGVhbTpDMDFGMlFNR0g4Qw==

dGVhbTpDMDFTV0hOTDM0NA==

dGVhbTpDMDIwSFFRSzlHUQ==

dGVhbTpDMDIzTkIwQ0FDQg==

dGVhbTpDMDI2TkVCUEU3Mg==

dGVhbTpDMDI5SzFZUzNVSA==

dGVhbTpDMDJERUJDQTVBTQ==

dGVhbTpDMDJGV1M3QUtGRw==

dGVhbTpDMDJKNUhaVVNOOA==

dGVhbTpDMDJMUzFLVjNQRg==

dGVhbTpDMDJQRDhZQjBQSg==

dGVhbTpDMDJTSkVLUTlQVg==

dGVhbTpDMDMwME1DMTdKVA==

dGVhbTpDMDMyTENESEE3Nw==

dGVhbTpDMDM1Rjg5NTJVVw==

dGVhbTpDMDM4QlNYQVQ4Vw==

dGVhbTpDMDNCOE5HQ01CUA==

ZXh0ZXJuYWw6QzAySFFLOFBCNUU=

Thanks !!



Solution 1:[1]


cursor parameter is used for paginating the data fetched using given API.
Each cursor value points to the next page of data.

You need to iteratively call the API (adding the received cursor value from each request) and store each response, till the cursor value becomes blank.

Best approach will be to implement a Do...While loop, where while condition will be cursor != ""

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Suyash Gaur