Skip to main content
Import / Export

Request a gb query table data import

This method requires the ImportTable and Queries:Get permissions to be associated with your role.

POST
/gb/queries/{query_id}/import/table
Authorizationstringheaderrequired

For accessing the API a valid token must be passed in all the queries in the 'Authorization' header.

A valid token is generated by the API and returned by the /authenticate method by supplying a valid username and password.

The following syntax must be used in the 'Authorization' header :

Bearer aaaaaa/bbbbbb.ccccccc.dddddd
query_idstringrequired

Query Id

Maximum string length: 10
Pattern: ^[1-9]{1}[0-9]*$
Audit-User-Idstringheader

(Optional) User Id to use for audit purposes. This header requires the Audit:UserIdOverride permission to be associated with your role.

Maximum string length: 5
Pattern: ^[1-9]{1}[0-9]*$

Body

multipart/form-data
duplicate_import_check_flagenum<string>default:yes

Perform duplicate gb_imports checksum check

Available options: yes, no
ignore_no_rows_error_flagenum<string>default:no

(Optional) If yes, queries that don't return any rows will return a success response.

This setting defaults to 'no', which means if the given query_id does not return any acceptable rows for import, a noRows validation exception will result.

Available options: yes, no
procedureenum<string>default:validate
Available options: validate, import
table_namestringrequired

Destination table name

Maximum string length: 64
Pattern: ^[a-z0-9\_]+$
timezonestringdefault:UTC

Timestamps in import files will be parsed in the specified timezone.

The timezone value can be given in several formats, none of which are case sensitive:

  • As a named time zone, such as 'Europe/Helsinki', 'US/Eastern', or 'MET'.
  • As a string indicating an offset from UTC of the form [H]H:MM, prefixed with a + or -, such as '+10:00', '-6:00', or '+05:30'. A leading zero can optionally be used for hours values less than 10;
Maximum string length: 100
Pattern: ^[a-zA-Z0-9\/\:\+\-\_]+$

Response

application/json

Success

formatenum<string>
Available options: csv, json
Example: csv
table_import_idstring
Example: a5f5b489d019521eb16f5c579faa9e15afc7a4bb