SlicingDice Documentation

SlicingDice - The All-in-One Solution Documentation

Welcome to the SlicingDice documentation. You'll find comprehensive guides and documentation to help you start working with SlicingDice as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    Guides

API Connection and Headers

First time checking our docs? You might want to start with the right foot by reading our Documentation Guide first.

This section will explain only JSON particularities if you're using a SQL Driver you can skip this guide.

API Connection

The connection with SlicingDice API is made using a single HTTPS endpoint, this endpoint is used for querying and inserting data on SlicingDice.

API endpoint

The endpoint https://api.slicingdice.com/v1/ is used for inserting and querying data.

$ curl -X GET https://api.slicingdice.com/v1/query/count/entity/total \
    -H 'Authorization: MASTER_API_KEY' \
    -H 'Content-Type: application/json'
from pyslicer import SlicingDice
slicingdice = SlicingDice(master_key='MASTER_API_KEY', uses_test_endpoint=True)

print(slicingdice.count_entity_total())
import com.slicingdice.jslicer.SlicingDice;
import java.io.IOException;
import org.json.JSONObject;
import org.json.JSONArray;

public class Example {
    public static void main(String[] args) throws IOException {
        SlicingDice slicingdice = new SlicingDice("MASTER_API_KEY", true);

        JSONObject result = slicingdice.countEntityTotal();
        System.out.println(result.toString());
    }
}
require 'rbslicer'
slicingdice = SlicingDice.new(master_key: 'MASTER_API_KEY', uses_test_endpoint: true)

puts slicingdice.count_entity_total()
const SlicingDice = require('slicerjs');

const usesTestEndpoint = true;
const slicingdice = new SlicingDice({masterKey: 'MASTER_API_KEY'}, usesTestEndpoint);

slicingdice.countEntityTotal().then((resp) => {
    console.log(resp);
}, (err) => {
    console.error(err);
});
<?php
use Slicer\SlicingDice;
$usesTestEndpoint = true;
$slicingdice = new SlicingDice(array("masterKey" => "MASTER_API_KEY"), $usesTestEndpoint);

print_r($slicingdice->countEntityTotal());
?>
using System.Collections.Generic;
using Slicer;
using Newtonsoft.Json;

namespace SlicerTester.Console
{
    class Program
    {
        static void Main(string[] args)
        {
            var slicingdice = new SlicingDice(masterKey: "MASTER_API_KEY", usesTestEndpoint: true);

            var result = slicingdice.CountEntityTotal();
            System.Console.WriteLine(JsonConvert.SerializeObject(result).ToString());
        }
    }
}
package main
import (
    "fmt"
    "github.com/SlicingDice/slicingdice-go/slicingdice"
)
func main() {
    keys := new(slicingdice.APIKey)
    keys.MasterKey = "MASTER_API_KEY"
    slicingdice := slicingdice.New(keys, 60)
    slicingdice.Test = true

    fmt.Println(slicingdice.CountEntityTotal())
}

API Headers

HTTP headers are required in order to interact with SlicingDice's API. This section contains information on all headers accepted and required by the API.

Authentication header

All requests must contain the Authorization header with a valid Database key. That's how we know you are the one using SlicingDice and also store statistics for each database usage.

In the following example, MASTER_DATABASE_KEY must be replaced by a valid database API key as found in the databases page.

$ curl -X GET https://api.slicingdice.com/v1/query/count/entity/total \
    -H 'Authorization: MASTER_DATABASE_KEY' \
    -H 'Content-Type: application/json'
from pyslicer import SlicingDice
slicingdice = SlicingDice(master_key='MASTER_DATABASE_KEY', uses_test_endpoint=True)

print(slicingdice.count_entity_total())
import com.slicingdice.jslicer.SlicingDice;
import java.io.IOException;
import org.json.JSONObject;
import org.json.JSONArray;

public class Example {
    public static void main(String[] args) throws IOException {
        SlicingDice slicingdice = new SlicingDice("MASTER_DATABASE_KEY", true);

        JSONObject result = slicingdice.countEntityTotal();
        System.out.println(result.toString());
    }
}
require 'rbslicer'
slicingdice = SlicingDice.new(master_key: 'MASTER_DATABASE_KEY', uses_test_endpoint: true)

puts slicingdice.count_entity_total()
const SlicingDice = require('slicerjs');

const usesTestEndpoint = true;
const slicingdice = new SlicingDice({masterKey: 'MASTER_DATABASE_KEY'}, usesTestEndpoint);

slicingdice.countEntityTotal().then((resp) => {
    console.log(resp);
}, (err) => {
    console.error(err);
});
<?php
use Slicer\SlicingDice;
$usesTestEndpoint = true;
$slicingdice = new SlicingDice(array("masterKey" => "MASTER_DATABASE_KEY"), $usesTestEndpoint);

print_r($slicingdice->countEntityTotal());
?>
using System.Collections.Generic;
using Slicer;
using Newtonsoft.Json;

namespace SlicerTester.Console
{
    class Program
    {
        static void Main(string[] args)
        {
            var slicingdice = new SlicingDice(masterKey: "MASTER_DATABASE_KEY", usesTestEndpoint: true);

            var result = slicingdice.CountEntityTotal();
            System.Console.WriteLine(JsonConvert.SerializeObject(result).ToString());
        }
    }
}
package main
import (
    "fmt"
    "github.com/SlicingDice/slicingdice-go/slicingdice"
)
func main() {
    keys := new(slicingdice.APIKey)
    keys.MasterKey = "MASTER_DATABASE_KEY"
    slicingdice := slicingdice.New(keys, 60)
    slicingdice.Test = true

    fmt.Println(slicingdice.CountEntityTotal())
}

If you are using one of our clients/SDKs, there is no need to manually define the Authorization header.

Content type header

All interactions with SlicingDice's API occur via JSON data, both for input and output. Therefore, all requests must have an HTTP header Content-Type: application/json to successfully use the API, otherwise errors will be produced.

If you are using one of our clients/SDKs, there is no need to manually define the Content-Type: application/json header.