Getting Started with API

Before you begin, make sure you have the following:

  • Flotiq Account: Sign up for an account on Flotiq website if you haven't already.
  • Content Types: Make sure you have already created the necessary Content Type Definitions in your Flotiq account. It should contain at least one Content Object.
  • API Key: Obtain your Application Read and Write API Key from the Flotiq dashboard. You'll need it to perform API operations.
  • Basic understanding of RESTful APIs: Familiarize yourself with the concepts of RESTful APIs if you're new to this.

Step 1: Implementing API Integration

Once you have your Content Type Definitions ready, you can proceed with integrating Flotiq API into your application. Here's a high-level overview of the steps involved:

  • Authentication: Use your API key to authenticate API requests. Include the key in the request headers or as a query parameter, depending on the API endpoint.
  • Data Manipulation: Perform CRUD operations (Create, Read, Update, Delete) on your Content Types using the appropriate API endpoints and HTTP methods.
  • Handling Responses: Handle the API responses in your application code to process the data returned by the API and handle errors gracefully.
  • Testing and Debugging: Use tools like CURL or Postman to test your API requests and ensure they are working as expected.
  • Best Practices: Follow best practices for API integration, such as using pagination for large result sets, implementing caching mechanisms, and handling rate limits.

Flotiq provides two options for retrieving data: REST API and GraphQL. Here's an overview of the steps involved:


Retrieve the schema of a specific Content Object by sending a GET request to the{name}/{id} endpoint. Check the documentation for more details.


curl --location --request GET "" \
--header "accept: application/json" \

var client = new RestClient("");
var request = new RestRequest(Method.GET);
request.AddHeader("X-AUTH-TOKEN", "YOUR_API_KEY");
IRestResponse response = client.Execute(request);

package main

import (

func main() {

    url := ""

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("X-AUTH-TOKEN", "YOUR_API_KEY")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)



OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
    .addHeader("X-AUTH-TOKEN", "YOUR_API_KEY")

Response response = client.newCall(request).execute();

HttpResponse<String> response = Unirest.get("")
    .header("X-AUTH-TOKEN", "YOUR_API_KEY")

const request = require('request');

const options = {
    method: 'DELETE',
    url: '',
    headers: {'X-AUTH-TOKEN': 'YOUR_API_KEY'},

request(options, function (error, response, body) {
    if (error) throw new Error(error);



$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "",
            "X-AUTH-TOKEN: YOUR_API_KEY",

$response = curl_exec($curl);
$err = curl_error($curl);


if ($err) {
    echo "cURL Error #:" . $err;
} else {
    echo $response;


Returned when the object was found

  "id": "blogposts-456712",
    "internal": {
        "contentType": "blogposts",
        "createdAt": "2021-04-09T13:30:48+00:00",
        "updatedAt": "2021-04-09T13:30:48+00:00",
        "deletedAt": ""
    "title": "New object",
    "postContent": "This will be the new <b>content</b>"

Returned when API key was missing or incorrect

    "code": 401,
    "massage": "Unauthorized"

Returned when content type definition wasn't found

    "code": 404,
    "massage": "Not found"

For GraphQL:

Flotiq supports GraphQL queries for Content Objects. You can use the following endpoints to interact with the system using GraphQL:

  • GET /api/graphql/schema - Retrieve the GraphQL schema that describes your data.
  • POST /api/graphql - Execute GraphQL queries to retrieve specific data.

To a get single object, you need to pass the object identifier and fields you want to receive in the response. Example Query in GraphQL language to get id and title for the product with id blogposts-456712 looks like:


query {
    blogposts(id:"blogposts-456712") {

To pass this query to the Flotiq, you need to call:


curl -X POST '' \
--header 'Content-Type: application/json' \
--data-raw '{"query":"query { blogposts(id: \"blogposts-456712\") { id title } }"}'

fetch('', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
    body: JSON.stringify({
        query: 'query { blogposts(id: "blogposts-456712") { id title } }'
.then(response => response.json())
.then(data => console.log(data));

const axios = require('axios');'', {
    query: 'query { blogposts(id: "blogposts-456712") { id title } }'
}, {
    headers: {
        'Content-Type': 'application/json',
.then(response => console.log(
.catch(error => console.log(error));

import requests

url = ''
headers = {
    'Content-Type': 'application/json',
data = {
    'query': 'query { blogposts(id: "blogposts-456712") { id title } }'

response =, headers=headers, json=data)


Returned when the object was found

    "data": {
        "blogposts": {
            "id": "blogposts-456712",
            "title": "New object"

Returned when the API key was missing or incorrect

    "errors": [
            "message": "Unauthorized",
            "extensions": {
                "code": "UNAUTHORIZED"

Returned when the content type definition wasn't found

    "errors": [
            "message": "Not found",
            "extensions": {
                "code": "NOT_FOUND"

Step 2: Exploring Advanced Features

Flotiq API offers various advanced features and functionalities to enhance your application. Here are a few examples:

  • Search: Perform advanced search queries to retrieve specific data from your Content Types.
  • Media Management: Upload and manage media assets such as images and videos in your application.

Congratulations! You now have a basic understanding of integrating Flotiq API into your application. Start by creating your Content Type Definitions and then follow the API integration steps to build powerful applications using Flotiq. If you need further assistance, refer to the specific sections in the documentation or reach out to our support team.