Question & Answer
Question
Do you have an example that shows how to define a configuration file for a rest api end point that uses pagination?
Answer
This sample is based on public rest api from the following site:
https://www.instantwebtools.net/fake-rest-api
Create configuration file called basic_paging.rest that contains the following:
{
"v1_passenger":{
"#path":[
"http://api.instantwebtools.net/v1/passenger"
],
"#maximumPageSize": 100,
"#firstPage":0,
"#pageSizeParameter": "size",
"#pageNumberParameter": "page",
"totalPassengers":"Integer,#key",
"totalPages":"Integer",
"data[]":{
"_id":"VarChar(36)",
"name":"VarChar(27)",
"trips":"Integer",
"airline[1]":{
"_id":"VarChar(64)",
"id":"Integer",
"name":"VarChar(21)",
"country":"VarChar(13)",
"logo":"VarChar(165)",
"slogan":"VarChar(66)",
"head_quaters":"VarChar(103)",
"website":"VarChar(31)",
"established":"Integer",
"__v":"Integer"
},
"__v":"Integer"
}
}
}
"v1_passenger":{
"#path":[
"http://api.instantwebtools.net/v1/passenger"
],
"#maximumPageSize": 100,
"#firstPage":0,
"#pageSizeParameter": "size",
"#pageNumberParameter": "page",
"totalPassengers":"Integer,#key",
"totalPages":"Integer",
"data[]":{
"_id":"VarChar(36)",
"name":"VarChar(27)",
"trips":"Integer",
"airline[1]":{
"_id":"VarChar(64)",
"id":"Integer",
"name":"VarChar(21)",
"country":"VarChar(13)",
"logo":"VarChar(165)",
"slogan":"VarChar(66)",
"head_quaters":"VarChar(103)",
"website":"VarChar(31)",
"established":"Integer",
"__v":"Integer"
},
"__v":"Integer"
}
}
}
Create a data server connection in Cognos.
Select the Progress DataDirect Autonomous Rest type and use the JDBC URL value:
jdbc:ibmcognos:autorest:config="C:\basic_paging.rest"
Modify the location to the basic_paging.rest file to match the location in your environment.
The schema imports 3 tables.
[{"Type":"MASTER","Line of Business":{"code":"LOB10","label":"Data and AI"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSTSF6","label":"IBM Cognos Analytics"},"ARM Category":[{"code":"a8m50000000Cl6nAAC","label":"Installation and Configuration->Data Sources"}],"ARM Case Number":"TS005689629","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"11.1.7"}]
Was this topic helpful?
Document Information
Modified date:
11 August 2021
UID
ibm16480671