Reporting API Reference

Welcome to the Reporting API reference page.

This page provides GraphQL API endpoint documentation where you can find queries/mutations for service-to-service integration.

Uploading files

To retrieve upload URL for a file use the following request:

curl --request POST \
  --url https://reporting-api.rekap.online/graphql \
  --header 'authorization: TOKEN {YOUR_API_TOKEN}' \
  --header 'content-type: application/json' \
  --data '{"variables":{"projectId":"YOUR_PROJECT_ID","filename":"YOUR_FILE_NAME"},"query":"query (: ID!,: String!) { token { project( id: ) { file(name: ) { uploadUrl } } } }"}'

API response:

You will receive upload URL in response:

{"data":{"token":{"project":{"file":{"uploadUrl":"https://....."}}}}}

Upload file:

After receiving uploadUrl from above request you can upload file using PUT request:

curl -X PUT 'https://rekap-etl-files.s3.eu-central-1.amazonaws.com/.....' -d @path-to-local-file.json

Retrieving list of available projects

To retrieve list of available projects send:

curl --request POST \
  --url https://reporting-api.rekap.online/graphql \
  --header 'authorization: TOKEN {YOUR_API_TOKEN}' \
  --header 'content-type: application/json' \
  --data '{"query":"query { token { projects { id name } } }"}'

API response:

{"data":{"token":{"projects":[{"id":"...","name":"..."}, ...]}}}

Fetching data

To fetch data from specific project using query send:

curl --request POST \
  --url https://reporting-api.rekap.online/graphql \
  --header 'authorization: TOKEN {YOUR_API_TOKEN}' \
  --header 'content-type: application/json' \
  --data '{"variables":{"projectId":"YOUR_PROJECT_ID","queries":["{query1}",...]},"query":"query (: ID!,: [String!]!) { token { project( id: ) { loadQueries(queries: ) { results } } } }"}'

Note that this API doesn't support direct SQL queries. Query must be serialized string using ts-query package (eg. "Q.select().from('table').serialize()")

API response:

{"data":{"token":{"project":{"results":"[[{\"column1\": \"value1\", \"column2\": \"value2\"}, ...]]"}}}}
Terms of Service

https://rekap.online

API Endpoints
# Production:
https://reporting-api.rekap.online/graphql
Headers
# Pregenerated API Token
Authorization: TOKEN {YOUR_TOKEN_HERE}

Queries

token

Response

Returns a Token

Example

Query
query Token {
  token {
    name
    tokenHash
    project {
      id
      name
      loadQueriesAsync
      file {
        name
        uploadUrl
        downloadUrl
      }
    }
    projects {
      id
      name
      loadQueriesAsync
      file {
        name
        uploadUrl
        downloadUrl
      }
    }
  }
}
Response
{
  "data": {
    "token": {
      "name": "abc123",
      "tokenHash": "xyz789",
      "project": Project,
      "projects": [Project]
    }
  }
}

Types

Boolean

Description

The Boolean scalar type represents true or false.

Example
true

File

Fields
Field Name Description
name - String!
uploadUrl - String!
downloadUrl - String!
Example
{
  "name": "xyz789",
  "uploadUrl": "abc123",
  "downloadUrl": "abc123"
}

ID

Description

The ID scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "4") or integer (such as 4) input value will be accepted as an ID.

Example
4

LoadQueriesAsyncInput

Fields
Input Field Description
queries - [String]!
callbackUrl - String!
Example
{
  "queries": ["abc123"],
  "callbackUrl": "abc123"
}

Project

Fields
Field Name Description
id - ID!
name - String!
loadQueriesAsync - Boolean!
Arguments
file - File!
Arguments
name - String!
Example
{
  "id": "4",
  "name": "abc123",
  "loadQueriesAsync": true,
  "file": File
}

String

Description

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

Example
"xyz789"

Token

Fields
Field Name Description
name - String
tokenHash - String!
project - Project
Arguments
id - ID!
projects - [Project!]!
Example
{
  "name": "xyz789",
  "tokenHash": "abc123",
  "project": Project,
  "projects": [Project]
}