Login

API Test Environment

Test ticket generation with a public API key. Tickets created here won't generate emails or notifications.

Test API Key

Use this API key to create test tickets. This key is publicly available and can be used by anyone for testing purposes.

qt_yL91jLB0ZXoJXpTgDklmGz4RetuuD1Cji5Eu43oG_so
Rotates in:

Example curl command:

curl -X POST https://bluetickets.app/api/tickets \
  -H "Authorization: Bearer qt_yL91jLB0ZXoJXpTgDklmGz4RetuuD1Cji5Eu43oG_so" \
  -H "Content-Type: application/json" \
  -d '{"title": "Test Ticket", "body": "This is a test", "requesterEmail": "[email protected]"}'

Language Examples

Prefer SDK-style code? Expand any section below to copy a ready-to-run example.

Node.js example(requires node-fetch)

Run npm install node-fetch@3 and execute with Node.js 18+.

import fetch from "node-fetch";

async function createTicket() {
	const response = await fetch("https://bluetickets.app/api/tickets", {
		method: "POST",
		headers: {
			"Authorization": "Bearer qt_yL91jLB0ZXoJXpTgDklmGz4RetuuD1Cji5Eu43oG_so",
			"Content-Type": "application/json"
		},
		body: JSON.stringify({
			title: "SDK ticket",
			body: "Created via Node.js example",
			requesterEmail: "[email protected]"
		})
	});

	if (!response.ok) {
		throw new Error(`Request failed: ${response.status} ${response.statusText}`);
	}

	console.log(await response.json());
}

createTicket().catch(console.error);
Python example(requires requests)

Run pip install requests and execute with Python 3.10+.

import requests

API_KEY = "qt_yL91jLB0ZXoJXpTgDklmGz4RetuuD1Cji5Eu43oG_so"
URL = "https://bluetickets.app/api/tickets"

payload = {
    "title": "SDK ticket",
    "body": "Created via Python example",
    "requesterEmail": "[email protected]"
}

headers = {
    "Authorization": f"Bearer {API_KEY}",
    "Content-Type": "application/json"
}

response = requests.post(URL, json=payload, headers=headers)

response.raise_for_status()
print(response.json())
Java example(Java 11+)

Uses built-in java.net.http package. Compile and run with Java 11+.

import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
import java.time.Duration;

public class CreateTicket {
    private static final String API_KEY = "qt_yL91jLB0ZXoJXpTgDklmGz4RetuuD1Cji5Eu43oG_so";
    private static final String URL = "https://bluetickets.app/api/tickets";

    public static void main(String[] args) throws Exception {
        String jsonBody = """
            {
                "title": "SDK ticket",
                "body": "Created via Java example",
                "requesterEmail": "[email protected]"
            }
            """;

        HttpClient client = HttpClient.newBuilder()
            .connectTimeout(Duration.ofSeconds(10))
            .build();

        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create(URL))
            .header("Authorization", "Bearer " + API_KEY)
            .header("Content-Type", "application/json")
            .POST(HttpRequest.BodyPublishers.ofString(jsonBody))
            .build();

        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
        
        if (response.statusCode() >= 200 && response.statusCode() < 300) {
            System.out.println(response.body());
        } else {
            throw new RuntimeException("Request failed: " + response.statusCode() + " " + response.body());
        }
    }
}

Live Ticket Stream

Tickets created with the test API key will appear here in real-time.

Loading tickets...