cancel
Showing results for 
Search instead for 
Did you mean: 

Pagination in REST GET API for UserVoice not giving expected results

Vikas2022
New Contributor II

Hello,

In Snaplogic I have established a connection with UserVoice rest API via Bearer token and I am also able to fetch data from the first iteration.

There are no errors, But unfortunately, I am not able to get data for the next iterations(pagination). I have used the Has next and Next URL properties of REST GET Snap for this.

JSON API response which I get from 1st iteration:

{
	"categories": [
		{
			"id": 426064,
			"name": "Dashboards",
			"suggestions_count": 2,
			"open_suggestions_count": 0,
			"created_at": "2022-04-27T13:42:03Z",
			"updated_at": "2022-06-27T14:49:53Z",
			"links": {
				"forum": 942688
			}
		},
		{
			"id": 403581,
			"name": "Data Integrity - Generic",
			"suggestions_count": 6,
			"open_suggestions_count": 3,
			"created_at": "2021-04-28T10:01:31Z",
			"updated_at": "2022-06-07T01:27:28Z",
			"links": {
				"forum": 933466
			}
		}
	],
	"links": {
		"categories.forum": {
			"type": "forums"
		}
	},
	"list_meta": null,
	"pagination": {
		"page": 1,
		"per_page": 20,
		"total_pages": 4,
		"total_records": 61,
		"cursor": "eyJzb3J0IjoiIiwidmFsIjpudWxsLCJsYXN0X2lkIjo0MDM1ODF9"
	}
}

Since I want to paginate until I get the cursor in response, so I am using the below setting in REST GET Snap
image

For reference, pagination in PostMan is working as expected.
image

Can someone, please help me in getting records in pagination?

Thanks.

1 REPLY 1

sprasad
Employee
Employee

I think the value for Has next is not evaluating to true.
Can you try by making changes so that the Has next property should be evaluated to true instead of a string value?