API Documentation

In-depth reference documentation for iQmetrix API's.

NAV

OVERVIEW

Data Connect Bridge is intended to be an alternative to database replication, and allows you to retrieve tables from your RQ database.

For examples of how Data Connect Bridge can be used, see Extended Examples.

Authentication

Data Connect Bridge supports many different methods of authentication, see Authentication Options.

ENDPOINTS

RESOURCES

TableColumn

Each table in the latest version of RQ will have a TableColumn resource for each of its columns

[
    {
        "TableName": "iQclerk_ARPaymentInvoicesAndPayments",
        "Column_Name": "ReferenceNumber",
        "Length": 30,
        "ORDINAL_POSITION": 8,
        "Type": "varchar"
    }
]
Name Description
TableName (String) Name of the table
Column_Name (String) Name of the column
Length (Integer) Maximum acceptable input size, where applicable
ORDINAL_POSITION (Integer) Position of the column in the table
Type (String) Database type

Delta

A resource representing changes to a table in the latest version of RQ.

[
    {
        "DeltaCount": 68,
        "DeltaTimeSec": 28704556,
        "Table": "CarrierIntegrationCustomerHandsets"
    }
]
Name Description
DeltaCount (Integer) Number of rows that have changes
DeltaTimeSec (Integer)  
Table (String) Name of a table in the latest version of RQ

REQUESTS

GET Table Schemas in Latest RQ

This request will return a list of the columns in each table in the latest version of RQ.

Definition

GET /bridge/current/schema?Auth={Auth}&Response={Response}

Headers

Example Request

GET /bridge/current/schema
Authorization: Bearer (Access Token)
Accept-Encoding: gzip

curl -X GET "https://dataconnectdemo.iqmetrix.net/bridge/current/schema" -H "Authorization: Bearer (Access Token)" -H "Accept-Encoding: gzip"
static IRestResponse GettingTableSchemasInLatestRq()
{
    var client = new RestClient("https://dataconnectdemo.iqmetrix.net/bridge/current/schema");
    var request = new RestRequest(Method.GET);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 
    request.AddHeader("Accept-Encoding", "gzip"); 

    

    return client.Execute(request);
}

import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse GettingTableSchemasInLatestRq() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpGet request = new HttpGet("https://dataconnectdemo.iqmetrix.net/bridge/current/schema");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept-Encoding", "gzip"); 
    
    return httpClient.execute(request);
}
require 'rest-client'


response = RestClient.get 'https://dataconnectdemo.iqmetrix.net/bridge/current/schema', {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept-Encoding' => 'gzip',
    } 

puts response

URI Parameters

Response Parameters

Array[TableColumn]

Example Response (Default)

HTTP 200 Content-Type: application/json
[
    {
        "TableName": "iQclerk_ARPaymentInvoicesAndPayments",
        "Column_Name": "ReferenceNumber",
        "Length": 30,
        "ORDINAL_POSITION": 8,
        "Type": "varchar"
    }
]

Example Response (JsonDataTable)

HTTP 200 Content-Type: application/json
{
    "Records": [
        {
            "TableName": "iQclerk_ARPaymentInvoicesAndPayments",
            "Column_Name": "ReferenceNumber",
            "Length": 30,
            "ORDINAL_POSITION": 8,
            "Type": "varchar"
        }
    ],
    "Schema": [
        {
            "Column_Name": "ColumnName",
            "Type": "datatype",
            "SafeType": "safetype",
            "Length": 100
        }
    ]
}

Example Response (XmlDataTable)

HTTP 200 Content-Type: text/xml
<Table>
  <Record>
    <TableName>iQclerk_ARPaymentInvoicesAndPayments</TableName>
    <Column_Name>ReferenceNumber</Column_Name>
    <Length>30</Length>
    <ORDINAL_POSITION>8</ORDINAL_POSITION>
    <Type>varchar</Type>
  </Record>
  <Schema>
    <Column_Name>ColumnName</Column_Name>
    <Type>datatybe</Type>
    <SafeType>safetype</SafeType>
    <Length>100</Length>
  </Schema>
</Table>

Example Response (CSV)

HTTP 200 Content-Type: text/csv
TableName,Column_Name,Length,ORDINAL_POSITION,Type
iQclerk_ARPaymentInvoicesAndPayments,ReferenceNumber,30,8,varchar

Example Response (Excel)

HTTP 200 Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
content-disposition: attachment;filename=reportname-2016-07-11.xlsx
Binary *.xlsx file

GET Rows from a Table in RQ

This request will return the contents of a table in the latest version of RQ. The response to this request will match the appropriate table schema defined in Getting Table Schemas in Latest RQ.

Definition

GET /bridge/current/data?Table={TableName}&Auth={Auth}&Response={Response}

Headers

Example Request

GET /bridge/current/data?Table=CarrierIntegrationCustomerHandsets
Authorization: Bearer (Access Token)
Accept-Encoding: gzip

curl -X GET "https://dataconnectdemo.iqmetrix.net/bridge/current/data?Table=CarrierIntegrationCustomerHandsets" -H "Authorization: Bearer (Access Token)" -H "Accept-Encoding: gzip"
static IRestResponse GettingRowsFromATableInRq()
{
    var client = new RestClient("https://dataconnectdemo.iqmetrix.net/bridge/current/data?Table=CarrierIntegrationCustomerHandsets");
    var request = new RestRequest(Method.GET);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 
    request.AddHeader("Accept-Encoding", "gzip"); 

    

    return client.Execute(request);
}

import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse GettingRowsFromATableInRq() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpGet request = new HttpGet("https://dataconnectdemo.iqmetrix.net/bridge/current/data?Table=CarrierIntegrationCustomerHandsets");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept-Encoding", "gzip"); 
    
    return httpClient.execute(request);
}
require 'rest-client'


response = RestClient.get 'https://dataconnectdemo.iqmetrix.net/bridge/current/data?Table=CarrierIntegrationCustomerHandsets', {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept-Encoding' => 'gzip',
    } 

puts response

URI Parameters

Response Parameters

Example Response (Default)

HTTP 200 Content-Type: application/json
[
    {
        "CarrierCustomerHandsetID": "7f1b91e2-9692-4efe-923b-7bc90720ccb8",
        "CarrierCustomerID": "62c24270-503a-4de4-9d75-416c92a748d7",
        "SaleInvoiceID": -1,
        "StoreID": 3,
        "PhoneMake": "null",
        "PhoneModel": "Unknown Device",
        "ESN": "",
        "IMEI": "354493046773064",
        "CustomTelephoneNumber": "8186368202",
        "BAN": "null",
        "SIM": "89014103254674079938",
        "MDN": "null",
        "ActivationDate": "2014-10-01T15:00:12.05",
        "ExpiryDate": "2014-10-01T15:00:12.05",
        "RateORServicePlanName": "null",
        "RateORServicePlanDescription": "null",
        "RateORServicePlanInclusions": "null",
        "RateORServicePlanSOC": "FN2NM0A60",
        "RateORServicePlanTerm": "null",
        "RateORServicePlanFeatures": "null",
        "RateORServicePlanContractTerm": "2",
        "SalesRepName": "null",
        "DealerName": "HJG6E",
        "BillingCycle": "null",
        "BillingCycleDate": 17,
        "DepositAmount": 0,
        "BillingCode": "",
        "IsActivatedIQ": 0,
        "RateORServicePlan2SOC": "null",
        "RateORServicePlan2Description": "null",
        "DealerCode": "null",
        "CompanyCode": "null",
        "PortInNumber": "null",
        "DepositIndicator": "No Deposit",
        "FlowType": "null",
        "ActivationTermType": "null",
        "IsBYOD": null,
        "Priority": null,
        "CarrierServiceResource": "null",
        "RowThumbprint": "1c1103c2-db83-4df9-a86d-1b649bf304ee",
        "RowInserted": "2014-10-01T15:00:12.05",
        "RowUpdated": "2014-10-01T15:00:12.05",
        "Operation": "Inserted"
    }
]

Example Response (JsonDataTable)

HTTP 200 Content-Type: application/json
{
    "Records": [
        {
            "CarrierCustomerHandsetID": "7f1b91e2-9692-4efe-923b-7bc90720ccb8",
            "CarrierCustomerID": "62c24270-503a-4de4-9d75-416c92a748d7",
            "SaleInvoiceID": -1,
            "StoreID": 3,
            "PhoneMake": "null",
            "PhoneModel": "Unknown Device",
            "ESN": "",
            "IMEI": "354493046773064",
            "CustomTelephoneNumber": "8186368202",
            "BAN": "null",
            "SIM": "89014103254674079938",
            "MDN": "null",
            "ActivationDate": "2014-10-01T15:00:12.05",
            "ExpiryDate": "2014-10-01T15:00:12.05",
            "RateORServicePlanName": "null",
            "RateORServicePlanDescription": "null",
            "RateORServicePlanInclusions": "null",
            "RateORServicePlanSOC": "FN2NM0A60",
            "RateORServicePlanTerm": "null",
            "RateORServicePlanFeatures": "null",
            "RateORServicePlanContractTerm": "2",
            "SalesRepName": "null",
            "DealerName": "HJG6E",
            "BillingCycle": "null",
            "BillingCycleDate": 17,
            "DepositAmount": 0,
            "BillingCode": "",
            "IsActivatedIQ": 0,
            "RateORServicePlan2SOC": "null",
            "RateORServicePlan2Description": "null",
            "DealerCode": "null",
            "CompanyCode": "null",
            "PortInNumber": "null",
            "DepositIndicator": "No Deposit",
            "FlowType": "null",
            "ActivationTermType": "null",
            "IsBYOD": null,
            "Priority": null,
            "CarrierServiceResource": "null",
            "RowThumbprint": "1c1103c2-db83-4df9-a86d-1b649bf304ee",
            "RowInserted": "2014-10-01T15:00:12.05",
            "RowUpdated": "2014-10-01T15:00:12.05",
            "Operation": "Inserted"
        }
    ],
    "Schema": [
        {
            "Column_Name": "ColumnName",
            "Type": "datatype",
            "SafeType": "safetype",
            "Length": 100
        }
    ]
}

Example Response (XmlDataTable)

HTTP 200 Content-Type: text/xml
<Table>
  <Record>
    <CarrierCustomerHandsetID>7f1b91e2-9692-4efe-923b-7bc90720ccb8</CarrierCustomerHandsetID>
    <CarrierCustomerID>62c24270-503a-4de4-9d75-416c92a748d7</CarrierCustomerID>
    <SaleInvoiceID>-1</SaleInvoiceID>
    <StoreID>3</StoreID>
    <PhoneMake>null</PhoneMake>
    <PhoneModel>Unknown Device</PhoneModel>
    <ESN></ESN>
    <IMEI>354493046773064</IMEI>
    <CustomTelephoneNumber>8186368202</CustomTelephoneNumber>
    <BAN>null</BAN>
    <SIM>89014103254674079938</SIM>
    <MDN>null</MDN>
    <ActivationDate>2014-10-01T15:00:12.05</ActivationDate>
    <ExpiryDate>2014-10-01T15:00:12.05</ExpiryDate>
    <RateORServicePlanName>null</RateORServicePlanName>
    <RateORServicePlanDescription>null</RateORServicePlanDescription>
    <RateORServicePlanInclusions>null</RateORServicePlanInclusions>
    <RateORServicePlanSOC>FN2NM0A60</RateORServicePlanSOC>
    <RateORServicePlanTerm>null</RateORServicePlanTerm>
    <RateORServicePlanFeatures>null</RateORServicePlanFeatures>
    <RateORServicePlanContractTerm>2</RateORServicePlanContractTerm>
    <SalesRepName>null</SalesRepName>
    <DealerName>HJG6E</DealerName>
    <BillingCycle>null</BillingCycle>
    <BillingCycleDate>17</BillingCycleDate>
    <DepositAmount>0.00</DepositAmount>
    <BillingCode></BillingCode>
    <IsActivatedIQ>0</IsActivatedIQ>
    <RateORServicePlan2SOC>null</RateORServicePlan2SOC>
    <RateORServicePlan2Description>null</RateORServicePlan2Description>
    <DealerCode>null</DealerCode>
    <CompanyCode>null</CompanyCode>
    <PortInNumber>null</PortInNumber>
    <DepositIndicator>No Deposit</DepositIndicator>
    <FlowType>null</FlowType>
    <ActivationTermType>null</ActivationTermType>
    <IsBYOD>null</IsBYOD>
    <Priority>null</Priority>
    <CarrierServiceResource>null</CarrierServiceResource>
    <RowThumbprint>1c1103c2-db83-4df9-a86d-1b649bf304ee</RowThumbprint>
    <RowInserted>2014-10-01T15:00:12.05</RowInserted>
    <RowUpdated>2014-10-01T15:00:12.05</RowUpdated>
    <Operation>Inserted</Operation>
  </Record>
  <Schema>
    <Column_Name>ColumnName</Column_Name>
    <Type>datatybe</Type>
    <SafeType>safetype</SafeType>
    <Length>100</Length>
  </Schema>
</Table>

Example Response (CSV)

HTTP 200 Content-Type: text/csv
CarrierCustomerHandsetID,CarrierCustomerID,SaleInvoiceID,StoreID,PhoneMake,PhoneModel,ESN,IMEI,CustomTelephoneNumber,BAN,SIM,MDN,ActivationDate,ExpiryDate,RateORServicePlanName,RateORServicePlanDescription,RateORServicePlanInclusions,RateORServicePlanSOC,RateORServicePlanTerm,RateORServicePlanFeatures,RateORServicePlanContractTerm,SalesRepName,DealerName,BillingCycle,BillingCycleDate,DepositAmount,BillingCode,IsActivatedIQ,RateORServicePlan2SOC,RateORServicePlan2Description,DealerCode,CompanyCode,PortInNumber,DepositIndicator,FlowType,ActivationTermType,IsBYOD,Priority,CarrierServiceResource,RowThumbprint,RowInserted,RowUpdated,Operation
7f1b91e2-9692-4efe-923b-7bc90720ccb8,62c24270-503a-4de4-9d75-416c92a748d7,-1,3,null,Unknown Device,,354493046773064,8186368202,null,89014103254674079938,null,2014-10-01T15:00:12.05,2014-10-01T15:00:12.05,null,null,null,FN2NM0A60,null,null,2,null,HJG6E,null,17,0.00,,0,null,null,null,null,null,No Deposit,null,null,null,null,null,1c1103c2-db83-4df9-a86d-1b649bf304ee,2014-10-01T15:00:12.05,2014-10-01T15:00:12.05,Inserted

Example Response (Excel)

HTTP 200 Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
content-disposition: attachment;filename=reportname-2016-07-11.xlsx
Binary *.xlsx file

GET Changes to a Table in RQ

This request will return a summary of the changes or “deltas” in a table in the latest version of RQ since a specified date.

Definition

GET /bridge/current/delta?Table={TableName}&RowDateTime={RowDateTime}&Auth={Auth}&Response={Response}

Headers

Example Request

GET /bridge/current/delta?Table=CarrierIntegrationCustomerHandsets&RowDateTime=2015-07-14T22:26:39.000Z
Authorization: Bearer (Access Token)
Accept-Encoding: gzip

curl -X GET "https://dataconnectdemo.iqmetrix.net/bridge/current/delta?Table=CarrierIntegrationCustomerHandsets&RowDateTime=2015-07-14T22:26:39.000Z" -H "Authorization: Bearer (Access Token)" -H "Accept-Encoding: gzip"
static IRestResponse GettingChangesToATableInRq()
{
    var client = new RestClient("https://dataconnectdemo.iqmetrix.net/bridge/current/delta?Table=CarrierIntegrationCustomerHandsets&RowDateTime=2015-07-14T22:26:39.000Z");
    var request = new RestRequest(Method.GET);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 
    request.AddHeader("Accept-Encoding", "gzip"); 

    

    return client.Execute(request);
}

import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse GettingChangesToATableInRq() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpGet request = new HttpGet("https://dataconnectdemo.iqmetrix.net/bridge/current/delta?Table=CarrierIntegrationCustomerHandsets&RowDateTime=2015-07-14T22:26:39.000Z");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept-Encoding", "gzip"); 
    
    return httpClient.execute(request);
}
require 'rest-client'


response = RestClient.get 'https://dataconnectdemo.iqmetrix.net/bridge/current/delta?Table=CarrierIntegrationCustomerHandsets&RowDateTime=2015-07-14T22:26:39.000Z', {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept-Encoding' => 'gzip',
    } 

puts response

URI Parameters

Response Parameters

Array[Delta]

Example Response (Default)

HTTP 200 Content-Type: application/json
[
    {
        "DeltaCount": 68,
        "DeltaTimeSec": 28704556,
        "Table": "CarrierIntegrationCustomerHandsets"
    }
]

Example Response (JsonDataTable)

HTTP 200 Content-Type: application/json
{
    "Records": [
        {
            "DeltaCount": 68,
            "DeltaTimeSec": 28704556,
            "Table": "CarrierIntegrationCustomerHandsets"
        }
    ],
    "Schema": [
        {
            "Column_Name": "ColumnName",
            "Type": "datatype",
            "SafeType": "safetype",
            "Length": 100
        }
    ]
}

Example Response (XmlDataTable)

HTTP 200 Content-Type: text/xml
<Table>
  <Record>
    <DeltaCount>68</DeltaCount>
    <DeltaTimeSec>28704556</DeltaTimeSec>
    <Table>CarrierIntegrationCustomerHandsets</Table>
  </Record>
  <Schema>
    <Column_Name>ColumnName</Column_Name>
    <Type>datatybe</Type>
    <SafeType>safetype</SafeType>
    <Length>100</Length>
  </Schema>
</Table>

Example Response (CSV)

HTTP 200 Content-Type: text/csv
DeltaCount,DeltaTimeSec,Table
68,28704556,CarrierIntegrationCustomerHandsets

Example Response (Excel)

HTTP 200 Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
content-disposition: attachment;filename=reportname-2016-07-11.xlsx
Binary *.xlsx file

EXTENDED EXAMPLES

These examples are intended to illustrate some suggested uses of Data Connect Bridge.

Data Replication

In this example, we will get a list of time off requests made since January 1st, 2016, which are stored in the table iQplanner_HR_RequestedTimeOff.

First we must see if there is any data using Getting Changes to a Table in RQ. This will return a list of “Deltas” or changes to the table since a specified date.

Example Request
GET https://rqdataconnectdemo.iqmetrix.net/bridge/current/delta?Table=iQplanner_HR_RequestedTimeOff&RowDateTime=2016-01-01T00:00:00.000Z
Authorization: Bearer (Access Token)
Example Response
[
  {
    "Table": "iQplanner_HR_RequestedTimeOff",
    "DeltaCount": 26,
    "DeltaTimeSec": 10844356
  }
]

From the response we can see there have been changes to 26 rows in the iQplanner_HR_RequestedTimeOff table since January 1st, 2016.

Next we must ensure the application we are building knows what the iQplanner_HR_RequestedTimeOff table looks like.

This data can be obtained using the Getting Table Schemas in Latest RQ.

Example Request
GET https://rqdataconnectdemo.iqmetrix.net/bridge/current/schema
Authorization: Bearer (Access Token)
Example Response
[
  ...,
  {
    "TableName": "iQplanner_HR_RequestedTimeOff",
    "Column_Name": "RequestID",
    "Type": "int",
    "Length": null,
    "ORDINAL_POSITION": 1
  },
  {
    "TableName": "iQplanner_HR_RequestedTimeOff",
    "Column_Name": "EmployeeID",
    "Type": "int",
    "Length": null,
    "ORDINAL_POSITION": 2
  },
  ...
]

From the response we can see the format of the data that will be returned in the next request, using Getting Rows from a Table in RQ

Example Request
GET https://rqdataconnectdemo.iqmetrix.net/bridge/current/data?Table=iQplanner_HR_RequestedTimeOff
Authorization: Bearer (Access Token)
Example Response
[
  {
    "RequestID": 39,
    "EmployeeID": 31,
    "DateFrom": "2011-11-05T08:30:00",
    "DateTo": "2011-11-05T17:30:00",
    "Type": 1,
    "Status": 1,
    "Notes": "Dentist",
    "ApprovedByID": 8,
    "ManagerNotes": "",
    "Paid": false,
    "PaidNotes": "",
    "TimeZoneID": 5,
    "SubmitDate": "2011-08-31T08:06:57.09",
    "RequestedByID": null,
    "DaysRequested": null,
    "RowThumbprint": "ac5a4ffa-3a4c-4424-9d88-4743517b8549",
    "RowInserted": "2011-08-31T08:06:57.09",
    "RowUpdated": null,
    "Operation": "Inserted"
  },
  ...
]

ERRORS

HTTP Status Code Description How to Resolve
HTTP 400 Bad Request Ensure request body is formatted properly
HTTP 401 Token is invalid Ensure Access Token is valid and has not expired
HTTP 403 Unauthorized Ensure Access Token is valid and user has appropriate security
HTTP 404 Not Found Ensure URI is valid
HTTP 500 Unexpected Error See Message in response for more information
Was this page helpful?