Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions content/docs/documentation/making-your-first-request.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ description: A beginner-friendly guide to making your first Whitepages API reque
icon: Play
---

Ready to test your API key? You can try it right here in your browser, or follow the step-by-step guide using Postman.
Ready to test your API key? Pick the use case that matches what you're building and try it right here in your browser or follow the step-by-step guide using Postman.

## Quick Test
## Try It Now

<ApiKeyTester />
Paste your API key once, then run a sample request for the use case you care about. Each section links to a deeper guide if you want to learn more.

<OnboardingTester />

## Using Postman (No Code Required)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
import { NextRequest, NextResponse } from "next/server";

export async function GET(request: NextRequest) {
const ALLOWED_ENDPOINTS = new Set(["person", "property"]);

export async function GET(
request: NextRequest,
{ params }: { params: Promise<{ endpoint: string }> },
) {
const { endpoint } = await params;
if (!ALLOWED_ENDPOINTS.has(endpoint)) {
return NextResponse.json({ error: "Invalid endpoint" }, { status: 404 });
}

const apiKey = request.headers.get("X-Api-Key");
const { searchParams } = new URL(request.url);

const queryString = searchParams.toString();
const url = `https://api.whitepages.com/v2/person?${queryString}`;
const url = `https://api.whitepages.com/v2/${endpoint}?${queryString}`;

try {
const response = await fetch(url, {
Expand Down
272 changes: 0 additions & 272 deletions src/components/activation/api-key-tester.tsx

This file was deleted.

Loading
Loading