Login
Home

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_S1DFU7YhrEaZG-b5oJRK9X5u3nuAlvYFV69kqy1UuYY
Rotates in:

Example curl command:

curl -X POST https://bluetickets.app/api/tickets \
  -H "Authorization: Bearer qt_S1DFU7YhrEaZG-b5oJRK9X5u3nuAlvYFV69kqy1UuYY" \
  -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_S1DFU7YhrEaZG-b5oJRK9X5u3nuAlvYFV69kqy1UuYY",
			"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_S1DFU7YhrEaZG-b5oJRK9X5u3nuAlvYFV69kqy1UuYY"
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_S1DFU7YhrEaZG-b5oJRK9X5u3nuAlvYFV69kqy1UuYY";
    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...