Introduction

The Extract API provides mechanisms to export rows from Custom Tables utilising filters.

Extract Resources

Custom Tables

Use the Custom Tables Extract resource to execute a request that returns paginated results for the provided table name and filters. If all results not returned initially, indicators provided will assist in retrieving the next page.

GET /extract/v1/custom-tables/{customTableDatabaseName}

Utilise this endpoint to extract filtered rows from the selected Custom Table. Filters are optional and consist of query parameter key / value pairs, i.e. {tableFieldName}={expectedValue}. Multiple filters can be provided and will be considered strictly as AND operations. Results are paginated.

Responses are JSON (application/json).

Request

$ curl 'https://gateway-domain.performio.co/gateway/extract/v1/custom-tables/test_table_name?field1=value1.1&field2=value1.2' -i -X GET \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer e9036e38-d67e-11e8-9f8b-f2801f1b9fd1'
Headers
Name Description

Authorization

OAuth 2.0 authentication token

Path Parameters
Parameter Description

customTableDatabaseName

String representing the database name of the Custom Table to extract.

Request Parameters
Parameter Description

field1

(Optional) String representing the database name of the Custom Table Field to compare for filtering, may be multiple provided.

page

(Optional) Number representing the page to retrieve. Pages start from 0.

size

(Optional) Number representing the records per page count. Default page size is 20 and the maximum is 2000.

Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 221

{
  "results" : [ {
    "field1" : "value1.1",
    "field2" : "value1.2",
    "field3" : "value1.3",
    "field4" : "value1.4"
  } ],
  "page" : {
    "totalPages" : 1,
    "totalElements" : 1,
    "hasNext" : false
  }
}
Path Type Description

results

Array

Array of results.

page

Object

Object representing result pagination.

page.totalPages

Number

Number representing the total pages at current page size.

page.totalElements

Number

Number representing the total possible elements for the request.

page.hasNext

Boolean

Boolean representing if there is a next page of results.

Error Conditions

Reason

Response

Custom Table cannot be found for the provided Custom Table database name.

HTTP/1.1 404 Not Found
Content-Type: application/json;charset=UTF-8
Content-Length: 195

{
  "timestamp" : 1617844256781,
  "status" : 404,
  "error" : "Not Found",
  "message" : "Could not find Custom Table with name test_table_name",
  "path" : "/v1/custom-tables/test_table_name"
}

Provided filter fields do not belong to the expected Custom Table.

HTTP/1.1 422 Unprocessable Entity
Content-Type: application/json;charset=UTF-8
Content-Length: 266

{
  "timestamp" : 1617844256715,
  "status" : 422,
  "error" : "Unprocessable Entity",
  "message" : "Unable to execute the extract.",
  "details" : [ "The following fields do not belong to test_table_name: field1" ],
  "path" : "/v1/custom-tables/test_table_name"
}

Unrecoverable internal server error during extract.

HTTP/1.1 500 Internal Server Error
Content-Type: application/json;charset=UTF-8
Content-Length: 184

{
  "timestamp" : 1617844256594,
  "status" : 500,
  "error" : "Internal Server Error",
  "message" : "Unable to execute the extract.",
  "path" : "/v1/custom-tables/test_table_name"
}