NextSign API
Getting Started

Test Environment

Build and validate your NextSign integration safely without affecting production data.

Test Environment

NextSign provides a Test Environment that is a full replica of the production environment. It allows you to safely build, test, and validate your integration without affecting live data or real signing workflows.

The test environment mirrors production behavior, APIs, and workflows, making it the perfect sandbox for development and quality assurance.


Use Cases

The test environment is ideal for:

  • API integration testing - Test all API endpoints and responses
  • Webhook testing - Validate webhook payloads and event handling
  • Document generation and signing flows - Test form submissions and case creation
  • End-to-end workflow validation - Verify complete signing workflows
  • Development and QA - Safe environment for developers and QA teams
  • Staging deployments - Pre-production testing before going live

Test Environment URL

Access the test environment at:

https://test.nextsign.dk

Test environment users are separate from production. You must create a new user on https://test.nextsign.dk to access the test environment, and all data and configurations are kept completely separate.


Key Characteristics

The test environment provides:

FeatureDescription
Same API structureIdentical endpoints and request/response formats as production
Same authenticationUses Bearer Token authentication, configured the same way
Same webhook flowFull webhook configuration and delivery system
Isolated dataNo impact on production data or workflows
Safe testingPerfect for development, QA, and staging purposes
Full feature parityAll production features available for testing

Data created in the test environment is completely isolated from production and may be periodically cleared. Do not rely on test data for long-term storage.


API Keys in Test Environment

API keys are environment-specific and cannot be shared between test and production.

Key Separation

You must generate separate API keys for:

  • ✅ Test environment - For development and testing
  • ✅ Production environment - For live applications

API keys created in the test environment are NOT valid in production, and vice versa. Attempting to use a production API key in the test environment will result in authentication errors.

Creating Test API Keys

Generate test API keys from the test environment dashboard:

  1. Create a new user on https://test.nextsign.dk and log in with that test account
  2. Navigate to Dashboard → Config → API Keys
  3. Click Create API Key
  4. Enter a descriptive name (e.g., Development API Key)
  5. Click Generate
  6. Copy and securely store the API key

Example test API key usage:

cURL - Test Environment
curl --location 'https://test.nextsign.dk/api/v2/{company}/cases/get' \
  -H 'Authorization: Bearer TEST_API_KEY_HERE'

Webhooks in Test Environment

Webhooks configured in the test environment are also isolated from production.

Test Webhook Behavior

Webhooks in the test environment:

  • ✅ Trigger only for test cases and test workflows
  • ✅ Must point to a publicly accessible test or staging endpoint
  • ✅ Are ideal for validating webhook payloads and event handling
  • ✅ Use the same event types and payload structure as production

For testing webhooks, you can:

  1. Use a staging server - Point to your staging/development backend
  2. Use webhook testing tools - Services like webhook.site or RequestBin
  3. Use ngrok for local development - Tunnel your local server for testing

Example test webhook configuration:

URL: https://staging.yourapp.com/webhooks
Headers:
  X-Signature: test-secret-key
Triggers:
  ☑ Case created
  ☑ Case signed
  ☑ Case denied

Test webhooks will only receive events from test cases. This ensures complete isolation between test and production environments.


Testing Best Practices

1. Use Environment Variables

Keep your API keys and configuration separate using environment variables:

.env.development
NEXTSIGN_API_URL=https://test.nextsign.dk/api
NEXTSIGN_API_KEY=your_test_api_key_here
NEXTSIGN_COMPANY_ID=your_test_company_id
.env.production
NEXTSIGN_API_URL=https://www.nextsign.dk/api
NEXTSIGN_API_KEY=your_production_api_key_here
NEXTSIGN_COMPANY_ID=your_production_company_id

2. Test All Event Types

Ensure you test all webhook event types in the test environment:

  • Case created
  • Recipient signed
  • Case signed
  • Case denied
  • Workflow completed

3. Validate Complete Workflows

Test the entire signing workflow from start to finish:

  1. Create a form or submit a case
  2. Send for signing
  3. Complete the signing process
  4. Verify webhook delivery
  5. Retrieve signed documents

4. Load Testing

Use the test environment for load testing to understand API rate limits and performance characteristics.

5. Error Handling

Test error scenarios:

  • Invalid API keys
  • Missing required fields
  • Malformed requests
  • Webhook failures and retries

Differences from Production

While the test environment mirrors production, be aware of these differences:

AspectTest EnvironmentProduction Environment
Data persistenceMay be periodically clearedPermanent storage
Email deliveryMay go to test email addressesReal recipient emails
e-ID loginTest users only, see Signing with an e-IDReal MitID, BankID and Personalausweis
e-BoksNot sentDelivered to the recipient's e-Boks
API keysSeparate test keys requiredSeparate production keys required
WebhooksPoint to staging/test endpointsPoint to production endpoints
Domaintest.nextsign.dknextsign.dk
PerformanceMay have lower rate limitsProduction rate limits

Email notifications in the test environment may be sent to test addresses or suppressed entirely to prevent accidental communication with real recipients.

e-Boks letters are not sent from the test environment, and neither are the physical letters that can replace them. To check an e-Boks letter, create the case in production as a draft ("state": "draft"): it is filled in, but nothing is sent. See Test before you send.


Signing with an e-ID in the test environment

An e-ID login in the test environment runs against the e-ID's own test system. A real MitID or BankID does not work there, and a test user does not work in production. Create a test user for each method you want to try before you open a signing link.

Each e-ID has its own test tools:

Signing methodWhat you needTest tools
MitID Privat (urn:grn:authn:dk:mitid:low, urn:grn:authn:dk:mitid:substantial)A MitID test user, and either the MitID test app or the app simulatorMitID Test Tool, MitID test app
MitID Erhverv (urn:grn:authn:dk:mitid:business)A test organization, and a test user connected to it as an employeeTest organization, MitID Test Tool, MitID Simulator
BankID SE (urn:grn:authn:se:bankid)A test BankID, and a BankID app set up for testingBankID test portal
BankID NO (urn:grn:authn:no:bankid)A test user from BankID Norway's pre-production portal, see belowBankID Norway test portal
Personalausweis (urn:grn:authn:de:personalausweis)The AusweisApp with its simulator, or a physical test cardAusweisApp
Touch (draw)Nothing. There is no e-ID loginNo test user needed

A few things that trip people up:

  • Create the test user first. A new Norwegian BankID test user can take up to an hour to become active.
  • One app, one environment. The Swedish BankID app works either in test or in production, not both, so use a separate device for testing. The MitID app has the same limit on Android. On iOS you can install both the test and the production app.
  • CPR match. For a recipient with needsCpr: true, send the CPR number of your MitID test user as the recipient's cpr. You find it in the MitID Test Tool.
  • Names. Give the recipient the same name as the test user. If the two names have nothing in common, a recipient_name_mismatch webhook is sent when the recipient signs.
  • BankID NO is not in the default set. Add urn:grn:authn:no:bankid to signingSchemas to offer it. See Signing Schemas.

To try the whole signing flow without any e-ID, offer draw (Touch). The recipient signs by drawing, so no test user is needed.

BankID NO test user

Norwegian BankID test users are created in BankID Norway's pre-production portal:

  1. Open the test portal and click Generate number. Copy the national identity number, because the portal does not store it.
  2. In the order form, enter a first name, a last name and a BankID friendly name. Choose Netcentric, choose BankID TestBank under HA services, and click Order.
  3. Click the pencil icon and add a phone number and an email address in the right format. Any values work, and nothing is sent to them.
  4. Wait for the test user to become active. This can take up to an hour.
  5. Sign in with the generated number as the user name, the one-time password otp and the password qwer1234. These two values are the same for every test user.

If the one-time password is rejected later, the test certificate has expired. Find the test user by its number in the portal, order a new Netcentric BankID with BankID TestBank, and try again.


Going Live

Once your integration has been fully tested in the test environment, follow these steps to deploy to production:

Pre-Launch Checklist

  • All API integrations tested and working in test environment
  • Webhook endpoints tested and validated
  • Complete signing workflows tested end-to-end
  • Error handling and edge cases covered
  • Security best practices implemented
  • Documentation and runbooks prepared

Migration Steps

  1. Switch to the production dashboard

  2. Generate production API keys

    • Navigate to Dashboard → Config → API Keys
    • Create new API keys for production use
    • Store them securely in your production secrets manager
  3. Update your application configuration

    • Replace test API keys with production keys
    • Update environment variables
    • Change API base URLs if different
    • Update company identifiers
  4. Recreate webhooks in production

    • Configure the same webhook triggers as test
    • Point to production endpoints (not staging)
    • Use production secret keys for signature validation
    • Test webhook delivery with a real case
  5. Verify production setup

    • Test a complete workflow in production
    • Verify webhook delivery
    • Check document retrieval
    • Monitor for errors

Example Environment Switch

config.js
const config = {
  test: {
    apiUrl: 'https://test.nextsign.dk/api',
    apiKey: process.env.NEXTSIGN_TEST_API_KEY,
    companyId: 'test-company-id'
  },
  production: {
    apiUrl: 'https://www.nextsign.dk/api',
    apiKey: process.env.NEXTSIGN_PROD_API_KEY,
    companyId: 'prod-company-id'
  }
};

const env = process.env.NODE_ENV || 'test';
module.exports = config[env];

Never use test API keys in production or production API keys in test. Always maintain strict separation between environments.


Monitoring and Debugging

Test Environment Logs

Monitor your test integration using:

  • Dashboard logs - View case creation and signing activity
  • Webhook logs - Check webhook delivery status and payloads
  • API response codes - Validate request/response patterns

Common Issues

Authentication Errors

  • Verify you're using test API keys in the test environment
  • Check that API keys are correctly configured in headers

Webhook Not Triggering

  • Ensure webhooks are enabled (Active toggle is ON)
  • Verify the webhook URL is publicly accessible
  • Check webhook logs in the dashboard for delivery errors

e-ID Login Fails

  • Use a test user from the e-ID's test system. A real MitID or BankID does not work in the test environment
  • Check that the e-ID app is set up for testing, not production
  • A new Norwegian BankID test user can take up to an hour to become active. If its one-time password is rejected later, the test certificate has expired: order a new test BankID for it, see BankID NO test user

Rate Limiting

  • Test environment may have lower rate limits than production
  • Design your client around the documented 100 requests per minute limit
  • Implement retry logic with exponential backoff

Support

If you encounter issues while testing:

  1. Check the dashboard logs for error messages
  2. Review the webhook delivery logs for webhook issues
  3. Verify your API key configuration
  4. Consult the API documentation for endpoint requirements
  5. Contact NextSign support with specific error details

When reporting issues, always specify whether the problem occurs in the test environment, production environment, or both.