and more in a single search tool across platforms. Read the announcement here. |
03/30/2023 05:49 AM
Hi Team,
We are trying to do pagination for accounts import for Adobe user management API.
The requirement is that we need to store the count of total pages, so that each time from the headers, we can increase the X-current page attribute by 1. We'll do this increment till the total count is reached and the last page attribute is true.
This is the URL that we are trying to hit:
https://usermanagement.adobe.io/v2/usermanagement/users/<orgID>/<pagenumber>
We want to increase page number till last page is "true"
The page number is stored at headers and not in response body. Could you please let us know the binding variable for this?
We have tried the following and they did not work:
+Math.addExact({headers?.X-Current-Page},1)
+math.addexact(Integer.parseInt(headers?.X-current page),1)
Could you please let us know how we can achieve this.
Regards,
Akanksha Handa
Solved! Go to Solution.
04/04/2023 11:36 AM
Hi @Akankshahanda ,
Try with below sample.
"pagination": {
"nextUrl": {
"nextUrlPath": "${response?.objectList?.size()>0?'https://examplesaviyntcom/organization-api-service/v1/management-units?page='+Math.addExact(response...}"
Thanks,
Hemanath J
04/06/2023 07:13 AM - edited 04/06/2023 07:18 AM
Hi @Akankshahanda ,
We're also integrating same application and stuck with the same issue. I have tried the pagination example shared by @Hemanath but didn't work for us. Please let me know if anything worked for you and also pls share the JSON example.
Regards,
Suyash
04/06/2023 07:29 AM
Hi @Suyash_Badnore1 , can you share the pagination which you have used in json with api
04/06/2023 07:54 AM - edited 04/06/2023 07:54 AM
Hi @Hemanth ,
PFB the pagination JSON and suggest if any modification is required here, we're having only lastPage attribute in response:
"pagination": {
"nextUrl": {
"nextUrlPath": "${(response?.completeResponseMap?.lastPage==true)?null:'https://usermanagement.adobe.io/v2/usermanagement/users/<ORG_ID>/' + Math.addExact(response.completeResponseMap.headers.X-Current-Page,1)}"
}
}
Thanks,
Suyash
04/06/2023 09:05 AM
@Suyash_Badnore1 @Akankshahanda how you are getting the next page data either by modifying X-Current-Page in the headers or what
04/06/2023 09:10 AM
@Hemanath , we're getting response as lastPage=true/false in response. In above example I was just trying if it would work using response headers, but it didn't work as well.
04/06/2023 09:25 AM
@Suyash_Badnore1 how you are getting the next data values from postman?
04/06/2023 09:30 AM
PFA the snapshots of response body & headers. The thing's we're not getting anyt nextURI or next_page values in the response body. Is there a way it would work with headers? Please help in understanding
04/06/2023 09:37 AM
Hi @Suyash_Badnore1 what data you will get when modifying X-Current-Page as 1 in postman
04/06/2023 09:41 AM
@Hemanath , when i update API with page number as 1 then it shows data of next page and X-Current-Page is updated as 1 : https://<URL>/v2/usermanagement/users/<ORG_ID>/1
04/06/2023 09:56 AM - edited 04/06/2023 09:57 AM
@Suyash_Badnore1 can you try below
{
"pagination": {
"nextUrl": {
"nextUrlPath": "${response?.objectList?.size()>0?'https://usermanagement.adobe.io/v2/usermanagement/users/<ORG_ID>/'+Math.addExact(headers?.X-Current-Page,1)+':null}"
}
}
}
}
04/06/2023 11:22 AM
@Hemanath I see below error:
Error - to Import Data correctly:
NullResponseFromTarget
04/07/2023 01:59 AM
Hi Hemanth,
We tried this exact same logic earlier, it did not work for us. Could you please suggest some other way to do this?
Regards,
Akanksha Handa
04/10/2023 03:07 AM
Hi Hemanth,
Could you please let us know if you were able to find something regarding the adobe pagination?
Regards,
Akanksha Handa
04/06/2023 11:32 AM
@Suyash_Badnore1 can you share your json
04/06/2023 11:41 AM - edited 04/06/2023 11:42 AM
04/18/2023 09:12 AM
04/12/2023 06:44 AM
05/05/2023 10:10 AM