Skip to main content

Testing the API with Your Organization

This guide explains how to use the API playground with your organization’s custom domain.

Using the Playground

The Nudj API supports multiple environments. When testing your API calls:

1. Select Your Server

At the top of any API endpoint page, you’ll see a server dropdown with these options:
  • Development Server - For testing (nudjdev.nudj.cx)
  • Staging Server - Pre-production testing (nudjstaging.nudj.cx)
  • Production Server - Your organization’s subdomain ({subdomain}.nudj.cx)
  • Local Development - Your local instance (localhost:3000)
For Custom Domains: Select the server closest to your environment, then modify the generated cURL command with your actual domain.

2. Add Your Authentication Token

In the x-api-token field, enter your API token:
  • Get your token from Developer Settings
  • The token will be automatically added to all requests
  • Format: Just paste the token directly

3. Test Your Request

  1. Fill in any required parameters
  2. Click Send to execute the request
  3. View the response in the playground

Testing with Custom Domains

Since each organization has its own domain (e.g., acme-corp.nudj.cx), follow these steps:
1

Use the Playground

Configure your request using the Development Server
2

Copy the cURL Command

Click the copy button to get the generated command
3

Replace the Domain

In your terminal, replace the domain:
# Original
curl -X GET https://nudjdev.nudj.cx/api/v2/admin/achievements \
  -H "x-api-token: YOUR_TOKEN"

# Modified for your org
curl -X GET https://your-subdomain.nudj.cx/api/v2/admin/achievements \
  -H "x-api-token: YOUR_TOKEN"

Alternative Testing Methods

Using Postman

  1. Import our OpenAPI specification
  2. Set your base URL to your organization’s domain
  3. Add your API token to the collection headers as x-api-token

Using Code

const response = await fetch('https://your-subdomain.nudj.cx/api/v2/admin/achievements', {
  headers: {
    'x-api-token': 'YOUR_TOKEN',
    'Content-Type': 'application/json'
  }
});

const data = await response.json();

Authentication Methods

The Nudj API uses token-based authentication:

API Token Header

x-api-token: YOUR_TOKEN
Optionally, you can include the Bearer prefix:
x-api-token: Bearer YOUR_TOKEN
Both formats work identically - the playground uses x-api-token without the prefix by default.

Troubleshooting

  • Verify your token is valid and not expired
  • Check you’re using the correct organization’s domain
  • Ensure the token has the required permissions
  • Confirm you’re using the correct API path (/api/v2/)
  • Verify your organization’s domain is correct
  • Check the endpoint exists for your API type (admin/integration/analytics)
  • The playground uses a proxy to avoid CORS issues
  • For direct browser requests, ensure your domain is whitelisted
  • Consider using server-side requests instead

Next Steps

I