Discussions

Ask a Question
Back to All

Getting pagination for links

Hi Support,

I am currently working on google sheet integration and need to list all existing short URL. I am trying to do this using the API and Google Scripts, but I am unable to get the pagination working. I've tried adding the "last" value as described on the page (https://developers.rebrandly.com/docs/understanding-pagination), but it isn't working.

The code I am executing is:

var headers = {
apikey: "xxxxxx",
workspace: "xxxxxx"
}
var params = {
headers: headers,
contentType: "application/json",
method: 'get',
muteHttpExceptions: false,
}
var response = UrlFetchApp.fetch("https://api.rebrandly.com/v1/links", params);

How do i need to modify this to get the pagination working?