Get Data

This endpoint allows you to get data from a database. This is useful should you want to get all data for that database or if you want to selectively query for rows of data based on specific conditions (perhaps to ascertain what data the database currently holds and to find whether it needs to be updated).

POST Parameters

ParameterRequiredValueDescription
api_key{key}An API key that has access to the resource you want to query for
database_id{integer}The ID of the database you want to get data for
column_id{string}Enter one or more column IDs as a comma-separated list (e.g., 123,456). Each ID should be a numeric identifier corresponding to specific columns.
row
type{string}Specify the data structure type. Accepted values are table or array. If left blank, the default value is table.
limit{integer}The number of rows that you want to have returned (Default: 100)
offset{integer}If the response contains more rows than the limit, you can choose at what row the result will show
conditions{associative array}The conditions allow you to set certain parameters which you want to filter the result on. E.g. you may wish to only return rows where certain column(s) contain certain value(s)
Information Circle

Using Conditions: You can pass either the column name or column ID within the conditions (e.g., conditions [123] is the same as conditions [columnA] if columnA had an ID of 123).

Example: conditions [columnA] =value1&conditions [columnB] =value2

Response Information

ElementDescription
<status>A status code in response to the operation.
<message>Additional information about the operation – human readable.
<data>The unique ID of the database.
<data>→<row>A container for the row of data (including its row_id)
<data>→<row>→<column>The column (and column_id) of the field of data and the data from within the row.

Example

Sample Request

POST https://api-app.xtracta.com/v1/databases/data HTTP/1.1
api_key=123&database_id_id=456789&conditions[A]=test&conditions[B]=value

Sample Response

<?xml version="1.0" encoding="UTF-8"?>
<databases_response>
    <status>200</status>
    <message>The request has been successfully processed</message>
    <data>
        <row id="1">
            <column id="61">test</column>
            <column id="62">value</column>
            <column id="63">51234124</column>
        </row>
        <row id="2">
            <column id="61">test</column>
            <column id="62">value</column>
            <column id="63">512363</column>
        </row>
        <row id="3">
            <column id="61">test</column>
            <column id="62">value</column>
            <column id="63">512390789</column>
        </row>
    </data>
</databases_response>

Schema Definition

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">

  <xs:simpleType name="ConfidenceType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:integer">
          <xs:minInclusive value="0"/>
          <xs:maxInclusive value="100"/>
        </xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value=""/>
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>

  <xs:complexType name="RowType">
    <xs:sequence>
      <xs:element name="column" type="ColumnType" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="id" type="xs:string" use="required"/>
  </xs:complexType>

  <xs:complexType name="DataType">
    <xs:sequence>
      <xs:element name="row" type="RowType" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="ColumnType">
    <xs:simpleContent>
      <xs:extension base="xs:string">
      <xs:attribute name="id" type="xs:string" use="required"/>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>

  <xs:element name="databases_response">
    <xs:complexType>
      <xs:sequence>
      <xs:element name="status" type="xs:positiveInteger"/>
      <xs:element name="message" type="xs:string"/>
      <xs:element name="data" type="DataType"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

</xs:schema>