Skip to main content
Question

API Rest Pagination for Freshdesk


Hi, 

is there anyone who managed to get the Freshdesk pagination working? 

I tried different ways but it is not working for me. Let me just describe what I did so far.

  1. trying with using Query Parameters and {TX_NextPage}, I tried using that since the freshdesk url is very easy to adjust with the page number, so I added this:

My URL is:

Pagination should look something like this https://[domain].freshdesk.com/api/v2/tickets?page=[number]

So, I added in the connection settings first the pagination rule which looks like this:

and I added the endpoint later for tickets.

This didn’t work, so I tried the same but adding it in the endpoint with Override pagination rules, unfortunately that didn’t work either. Any other parameters, such as pagesize, or include-stats works, perfectly fine, but the pagination simply doesn’t. 

So after trying this two, I tried another way.

 

  1. Trying using the header link from response. The query response posts the next page link in the headers, so I tried utilizing that setup, but simply couldn’t figure out what I should use as “value” and I cannot find anywhere some guidance regarding this. Probably my mistake, but would appreciate if someone has tried this and can help. 

that is how I tried:

I again tried in both the connection settings and the endpoint pagination override, but it doesn’t work.

 

  1. Finally, I tried to build a connection query string, using the link and the {TX_NextPage} variable, but that didn’t give me any difference either. 

Before you recommend it, I read and gone through these articles:

TimeXtender REST data source | Community

nested API pagination problem | Community

Use socrata opendata in a TimeXtender REST data source to do offset and limit pagination | Community

 

Probably my fault, but that doesn’t give me unfortunately any results either.

Also, important information, in all cases, I can get the first page of data from Freshdesk, but nothing else. So the connection does work, pagination doesn’t. 

 

Anyone here who managed to get it working and can help?

andrew.gebhard
TimeXtender Xpert
Forum|alt.badge.img+2

Hi Boglarka, 

Are you getting any pages of data back from the API after enabling the setting? You could enable caching to disk to inspect the data being collected.

Could you also please share the SQL query you are using to populate the TX_NextPage variable? Even if you do not need to manipulate the value (e.g. TX_CurrentPage * [# records per page]) I believe you still need to use the SQL expression. Afaik the provider will simply collect one page of data if it does not succeed in making a connection for the SQL expression. 

Kind regards,

Andrew


All right, I guess we are getting there. So I didn’t enable caching, I did it now, but before I test, to your next question: no I don’t have any SQl query added to populate the TX_NextPage variable, my understanding from all the links, and the documentation is that this is a pre-defined variable which basically offsets the current page by one. Is it not the case? could you help in this case what would be the SQL expression or what should be added there?


Thomas Lind
Community Manager
Forum|alt.badge.img+5

Hi ​@Boglarka Barany 

I don’t think you need any SQL query. I am wondering about the ‘link’ part, are you sure you need those ‘ ‘ around the part.

When the next URL is part of the response, it is easy to point at it with a XPath, but when it is a header it is not shown in the caching result.

You can try to turn on Debug logging to see what is returned in the headers though.


Ah, gotcha, no about the ‘link’, i only added it to show it is a link, not sure what should be really the reference, that is I guess the problem.

 

I tried the chaching, and the page = TX_NextPage version, it doesn’t help, unfortunately nothing more than the first page is loaded. 


andrew.gebhard
TimeXtender Xpert
Forum|alt.badge.img+2

At the risk of directing you to a support article you may have already read, here is another! 
Connecting to AFAS with the TX REST Connector | Community

In this example for the pagination, the provider needs a number of rows instead of a number of pages. So the SQL expression is ‘SELECT {TX_CurrentPage} * [PageSize] as skip’

I imagine for you it would be something like ‘SELCT {TX_NextPage} as next_page_value’. Then, in the query parameters section of the pagination options, you can set a parameter ‘page’ with value {next_page_value}. 

Pagination can be a bit esoteric since every API implements it differently, but hopefully this can point you down the right path. 

Kind regards,

Andrew


Okay, thanks, I can give this a try! 


Another Q, what should be the connection string in this case? 


andrew.gebhard
TimeXtender Xpert
Forum|alt.badge.img+2

Hi Boglarka, in case you need to use a SQL expression you should be connecting to (one of the) SQL Servers used as storage for a prepare instance. TX will attempt to connect to there from the server where the ingest service is running. 

However, according to Thomas it may not be necessary to have a SQL expression to make it work, since you don't do any manipulation of the TX_NextPage parameter. 

Kind regards,

Andrew


andrew.gebhard wrote:

Hi Boglarka, in case you need to use a SQL expression you should be connecting to (one of the) SQL Servers used as storage for a prepare instance. TX will attempt to connect to there from the server where the ingest service is running. 

However, according to Thomas it may not be necessary to have a SQL expression to make it work, since you don't do any manipulation of the TX_NextPage parameter. 

Kind regards,

Andrew

Yeah, however I tried without any SQL and the same thing happens, first page loaded and nothing else (that is basically what I also tried before, just not with caching). The parameter is not taken. I can give a try to the SQL version, maybe that works by any chance 


Okay, tried with SQL expression, same result. The pagination doesn’t work, it only loads the first page. 


Thomas Lind
Community Manager
Forum|alt.badge.img+5

Hi ​@Boglarka Barany 

You can send me a connection profile export in a private message if you want me to look at it.

You can’t attach files but you can add the export as text in it. I seem to have worked with Freshdesk before, it should be possible to make it work.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings