Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

OKTA Paginiation changed?

ejeong
Valued Contributor
Valued Contributor

I am busing okta REST connection to pull all application as entitlement

it used to use following pagination to get all info 

"pagination": {
"nextUrl": {
"nextUrlPath": "${(headers.Link?.contains(','))? headers.Link?.split(',')[1].replace('<', '').replace('>; rel=\"next\"','').trim() : ''}"
}

when checked today, it seems api is changed compared to what I looked last year

It used to be one :"link" in header with comma seperator but now it is showing two seperate "link" 

ejeong_1-1690258625125.png

 

 

can anyone share what would be pagination for this?

2 REPLIES 2

SB
Saviynt Employee
Saviynt Employee

You can refer to below format and construct accordingly

"pagination": {

                    "nextUrl": {

                        "nextUrlPath": "${(headers?.link?.split(',').size()==2 && headers?.link.contains('next'))?headers.link.split(',')[1].replace('<', '').replace('>; rel=\"next\"','').trim():null}"

                    }

                }

In above example, we are calling the link attribute under headers.

The split is used to tell that the different url links are separated by a comma (,)

size()==2 is used to tell how many links are received in the response header. In our case its 2

headers?.link.contains('next') – is defined to look for the url that includes next keyword. Next represents that this is the url to be called after the current one.

(users?after=00u1ecb28rdo2RpeH0h8&limit=3>; rel="next)

headers.link.split(',')[1] –  to split the first url from second and use 2nd one

replace('<', '').replace('>; rel=\"next\"','').trim() – the is just replace function to ensure we can fetch the clean url valu to be used in subsequent call.

 


Regards,
Sahil

rushikeshvartak
All-Star
All-Star

 

rushikeshvartak_1-1690371334630.png

 

 

 


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.