EverydayTech Platform - Developer Reference
Complete Source Code Documentation - All Applications
Loading...
Searching...
No Matches
Moniker Domain Registration API Integration

This document explains how to use and configure the Moniker domain registration API integration.

Quick Start

The system is pre-configured with test credentials and ready to use immediately. No setup required!

Configuration

Test API (Default - Already Configured)

The system uses Moniker's test API by default:

MONIKER_BASE_URL=https://testapi.moniker.com
MONIKER_API_KEY=monikerapi
MONIKER_PASSWORD=monikerpass

These credentials are already set in your .env file and work out of the box for testing.

Production API (When Ready)

When you receive your production Moniker credentials, update .env:

MONIKER_BASE_URL=https://api.moniker.com
MONIKER_API_KEY=your_production_api_key
MONIKER_PASSWORD=your_production_password
NODE_ENV=production

Testing the Integration

Run the test script to verify everything works:

node scripts/test_moniker.js

Expected output:

๐Ÿงช Testing Moniker API Integration
==================================================
๐Ÿ“‹ Test 1: Checking domain availability
--------------------------------------------------
Checking: example.com
[Moniker] Using TEST API with default credentials
โœ… Result: {
"domain": "example.com",
"available": false,
"status": "UNAVAILABLE",
...
}
๐Ÿ“‹ Test 2: Checking multiple domains
--------------------------------------------------
โœ… All tests passed!
๐ŸŽ‰ Moniker API integration is working correctly

Available Functions

Check Domain Availability

const moniker = require('./services/moniker');
const result = await moniker.checkDomain('example.com');
console.log(result);
// {
// domain: 'example.com',
// available: false,
// status: 'UNAVAILABLE',
// isPremium: false,
// minRegPeriod: '1Y',
// maxRegPeriod: '10Y',
// currency: 'USD'
// }

Check Multiple Domains

const results = await moniker.checkDomains([
'example1.com',
'example2.com',
'example3.com'
]);

Register Domain

const result = await moniker.registerDomain({
domain: 'newdomain.com',
years: 1,
nameservers: ['ns1.example.com', 'ns2.example.com'],
ownercontact: {
firstName: 'John',
lastName: 'Doe',
email: 'john@example.com',
// ... other contact details
}
});

Get Domain Info

const info = await moniker.getDomainInfo('example.com');

Update Nameservers

const result = await moniker.updateNameservers('example.com', [
'ns1.newhost.com',
'ns2.newhost.com'
]);

Transfer Domain

const result = await moniker.transferDomain({
domain: 'example.com',
authcode: 'EPP-CODE-HERE',
years: 1
});

Renew Domain

const result = await moniker.renewDomain('example.com', 1); // 1 year

API Response Format

Moniker's test API returns data in key=value format, one per line:

transactid=abc123
status=AVAILABLE
domain=example.com
minregperiod=1Y

Our service automatically parses this into a JavaScript object:

{
transactid: 'abc123',
status: 'AVAILABLE',
domain: 'example.com',
minregperiod: '1Y'
}

Domain Request Approval Workflow

  1. User submits request โ†’ Creates domain_registration_requests record with status pending
  2. Notification created โ†’ Root tenant admins receive notification
  3. Admin reviews โ†’ Views request in dashboard
  4. Admin approves/denies โ†’ Updates request status
  5. If approved โ†’ Can trigger Moniker registration

Check API From Dashboard

When logged in as admin, open browser console and run:

// Check domain availability
fetch('/api/domains/check?domain=example.com', {
headers: { 'Authorization': 'Bearer ' + localStorage.getItem('token') }
}).then(r => r.json()).then(console.log)
// View pending requests
fetch('/api/domain-requests?status=pending', {
headers: { 'Authorization': 'Bearer ' + localStorage.getItem('token') }
}).then(r => r.json()).then(console.log)

Creating Notifications for Domain Requests

To backfill notifications for existing domain requests:

// In browser console while logged in as admin:
fetch('/api/domain-requests/backfill-notifications', {
method: 'POST',
headers: {
'Authorization': 'Bearer ' + localStorage.getItem('token'),
'Content-Type': 'application/json'
}
}).then(r => r.json()).then(console.log)

This will create notifications for all domain requests that don't have one yet.

Troubleshooting

Test API Not Responding

The test API credentials are publicly available and may be rate-limited. If you encounter issues:

  1. Wait a few minutes and try again
  2. Check the error message in console
  3. Verify network connectivity

Production API Issues

When using production credentials:

  1. Verify credentials are correct
  2. Ensure NODE_ENV=production is set
  3. Check your Moniker account has sufficient credits
  4. Review Moniker's API documentation for specific error codes

API Case Insensitivity

Moniker's API is case-insensitive for all parameters:

Domain/Check?ApiKey=... โœ…
domain/check?apikey=... โœ…
DOMAIN/CHECK?APIKEY=... โœ…

All are equivalent and work the same way.

Next Steps

  1. โœ… Test API integration is working (run test script)
  2. โœ… Demo data with domain requests is created
  3. โœ… Notifications are backfilled
  4. โณ Request production Moniker API credentials
  5. โณ Update .env with production credentials
  6. โณ Test domain registration in production

Support