Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

REST - Pagination using nexturl method not working

meegeaten
New Contributor II
New Contributor II
Hi,
 
I am trying to use below guide from the rest connector document (https://saviynt.freshdesk.com/support/solutions/articles/43000521736-rest-connector-guide) under NextURL section to perform the pagination but getting an error.
 
Could you please check and let me know if my nextURLPath is correct based on the POSTMAN response?
Attached saviynt error logs as reference.
 
Postman Response
{
    "_links": {
        "next": {
            "href": "/api/v2/users/?page=2&attributes=id%2Cuser.is-active%2Cuser.first-name%2Cuser.last-name%2Cis-super-admin%2Cis-devops-admin%2Cis-global-viewer%2Chas-api-access",
            "title": "Next List Page"
        }
    },
    "total": 24,
    "count": 10,
    "_embedded": [
        {
            "_links": {
                "self": {
                    "href": "/api/v2/users/2/",
                    "title": "Maxis Admin"
                }
            },
            "user.email": "probins-ext@cloudbolt.io",
            "user.username": "maxadmin",
            "id": "2",
            "user.is-active": "True",
            "user.first-name": "Maxis",
            "user.last-name": "Admin",
            "is-super-admin": "True"
        }
    ]
}
 
Saviynt importAccount JSON
                "pagination": {
                  "nextUrl": {
                    "nextUrlPath": "${response?.completeResponseMap?_links.next.href==null?null:response.completeResponseMap?_links.next.href}"
                  }
                }
3 REPLIES 3

Rajesh-R
Saviynt Employee
Saviynt Employee

Hi Meegeaten,

When you look for the Pagination JSON element, The hostname is missing in the nextURL Path.

                "pagination": {
                  "nextUrl": {
                    "nextUrlPath": "${response?.completeResponseMap?_links.next.href==null?null: 'https://hostname/' + response.completeResponseMap?_links.next.href}"
                  }
                }

Try out the above recommendation and get back.

 


Thanks
Rajesh Ramalingam
Saviynt India

meegeaten
New Contributor II
New Contributor II

Hi Rajesh,

I have implemented the suggested recommendation and constructed importAccEnt JSON as below.

Could you please verify on the pagination? Thanks.

{
"accountParams": {
"connection": "userAuth",
"processingType": "SequentialAndIterative",
"statusAndThresholdConfig": {
"deleteLinks": true,
"accountThresholdValue": 1000,
"correlateInactiveAccounts": true,
"inactivateAccountsNotInFile": false,
"statusColumn": "customproperty3",
"activeStatus": [
"True"
]
},
"call": {
"call1": {
"callOrder": 0,
"connection": "userAuth",
"stageNumber": 0,
"http": {
"url": "https://test-rightcloud.maxis.com.my/api/v2/users/?attributes=id,user.is-active,user.first-name,user.last-name,is-super-admin,is-devops-admin,is-global-viewer,has-api-access",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"httpMethod": "GET"
},
"listField": "_embedded",
"keyField": "accountID",
"statusConfig": {
"active": ["True"],
"inactive": ["False"]
},
"colsToPropsMap": {
"accountID": "user~dot#username~#~char",
"name": "user~dot#username~#~char",
"status": "user~dot#is-active~#~char",
"displayName": "#CONST#${response.id != null? response.'user.first-name'+' '+ response.'user.last-name' : null}~#~char",
"customproperty1": "user~dot#email~#~char",
"customproperty2": "id~#~char",
"customproperty3": "user~dot#is-active~#~char",
"customproperty4": "is-super-admin~#~char",
"customproperty31": "STORE#ACC#ENT#MAPPINGINFO~#~char"
},
"pagination": {
"nextUrl": {
"nextUrlPath": "${response?.completeResponseMap?_links.next.href==null?null: 'https://test-rightcloud.maxis.com.my/api/v2/users/?attributes=id,user.is-active,user.first-name,user.last-name,is-super-admin,is-devops-admin,is-global-viewer,has-api-access' + response.completeResponseMap?_links.next.href}"
}
}
}
}
}
}

Rajesh-R
Saviynt Employee
Saviynt Employee

Hi Micky,

Please try the following for the Pagination

"pagination": {
"nextUrl": {
"nextUrlPath": "${response?.completeResponseMap?_links.next.href==null?null: 'https://test-rightcloud.maxis.com.my' + response.completeResponseMap?_links.next.href}"
}

 


Thanks
Rajesh Ramalingam
Saviynt India