This API is used to get table data from a database registered inside the Lyftrondata app. The API will return data in batches in JSON form. The batch size will be provided by user at the time of creating request. User need to include Auth token in request header. The token can be retrieved using Get OAuth Token call.
Request Headers
Key |
Value |
Content-Type |
application/json |
Authorization |
Bearer {Token Value} |
Request Type |
Post |
URL |
http://{YourLyftrondataAppUrl}/api/1.0/tsql/gettabledata |
*** {Token Value} will be replaced by Auth token that was received in GetOAuthToken request.
*** {YourLyftrondataAppUrl} will be replaced with your Lyftrondata App url.
Example
Request Parameters
Request body will contain the following parameters as a JSON object.
Parameter |
Type |
Required |
Description |
DatabaseName |
String |
Yes |
Name of source or target database having table |
TableName |
String |
Yes |
Name of table |
Schema |
String |
Yes |
Schema name for which the table is part of |
PageNumber |
int |
No |
Represent batch number for record set having the records. Default value is 1 |
PageSize |
int |
No |
Represent number of records to be fetched in one request. Default value is 10 |
Example
{
"DatabaseName":"adventureworks-source",
"TableName":"Customer",
"Schema":"Sales",
"PageNumber":1,
"PageSize":5
}
Response Parameters
Parameter | Description |
tsql | Tsql used at server side. Value will be null always |
currentDatabase | Name of database having table |
messages | For any additional info from server. Default value is null |
totalRows | Total number of records in table |
totalPages | Total number of records divided by provided page size in request |
items | Array of items having table columns and rows |
columns | Having object of column of table having all the information related to column |
rows | Having row object with values of each column |
Example
{
"tSql":null,
"currentDatabase":"adventureworks-source",
"messages":null,
"totalRows":19820,
"totalPages":3964,
"items":[
{
"columns":[
{
"name":"CustomerID",
"type":{
"dbType":"int",
"initializedWithDefaultSize":true,
"length":4,
"isNullable":false,
"precision":10,
"scale":0,
"isSensitive":false,
"encryptingConnectionName":null,
"isEncrypted":false,
"sizeInBytes":4,
"providerSpecificData":null,
"serializerTypeId":35
},
"columnIndex":0
},
{
"name":"PersonID",
"type":{
"dbType":"int",
"initializedWithDefaultSize":true,
"length":4,
"isNullable":true,
"precision":10,
"scale":0,
"isSensitive":false,
"encryptingConnectionName":null,
"isEncrypted":false,
"sizeInBytes":4,
"providerSpecificData":null,
"serializerTypeId":35
},
"columnIndex":1
},
{
"name":"StoreID",
"type":{
"dbType":"int",
"initializedWithDefaultSize":true,
"length":4,
"isNullable":true,
"precision":10,
"scale":0,
"isSensitive":false,
"encryptingConnectionName":null,
"isEncrypted":false,
"sizeInBytes":4,
"providerSpecificData":null,
"serializerTypeId":35
},
"columnIndex":2
},
{
"name":"TerritoryID",
"type":{
"dbType":"int",
"initializedWithDefaultSize":true,
"length":4,
"isNullable":true,
"precision":10,
"scale":0,
"isSensitive":false,
"encryptingConnectionName":null,
"isEncrypted":false,
"sizeInBytes":4,
"providerSpecificData":null,
"serializerTypeId":35
},
"columnIndex":3
},
{
"name":"AccountNumber",
"type":{
"dbType":"varchar",
"initializedWithDefaultSize":false,
"length":10,
"isNullable":false,
"precision":0,
"scale":0,
"isSensitive":false,
"encryptingConnectionName":null,
"isEncrypted":false,
"sizeInBytes":5,
"providerSpecificData":null,
"serializerTypeId":35
},
"columnIndex":4
},
{
"name":"rowguid",
"type":{
"dbType":"uniqueidentifier",
"initializedWithDefaultSize":true,
"length":16,
"isNullable":false,
"precision":0,
"scale":0,
"isSensitive":false,
"encryptingConnectionName":null,
"isEncrypted":false,
"sizeInBytes":16,
"providerSpecificData":null,
"serializerTypeId":35
},
"columnIndex":5
},
{
"name":"ModifiedDate",
"type":{
"dbType":"datetime",
"initializedWithDefaultSize":true,
"length":8,
"isNullable":false,
"precision":23,
"scale":3,
"isSensitive":false,
"encryptingConnectionName":null,
"isEncrypted":false,
"sizeInBytes":8,
"providerSpecificData":null,
"serializerTypeId":35
},
"columnIndex":6
}
],
"rows":[
[
"1",
"NULL",
"934",
"1",
"AW00000001",
"3f5ae95e-b87d-4aed-95b4-c3797afcb74f",
"2008-10-13 11:15:07.263"
],
[
"2",
"NULL",
"1028",
"1",
"AW00000002",
"e552f657-a9af-4a7d-a645-c429d6e02491",
"2008-10-13 11:15:07.263"
],
[
"3",
"NULL",
"642",
"4",
"AW00000003",
"130774b1-db21-4ef3-98c8-c104bcd6ed6d",
"2008-10-13 11:15:07.263"
],
[
"4",
"NULL",
"932",
"4",
"AW00000004",
"ff862851-1daa-4044-be7c-3e85583c054d",
"2008-10-13 11:15:07.263"
],
[
"5",
"NULL",
"1026",
"4",
"AW00000005",
"83905bdc-6f5e-4f71-b162-c98da069f38a",
"2008-10-13 11:15:07.263"
]
],
"rowsAffected":-1,
"maxResults":5,
"generateFormattedRows":true
}
],
"success":true,
"errors":[
]
}