Troubleshooting

This guide provides solutions to common issues encountered when integrating with AS2aaS.

Table of Contents

Authentication Issues

Invalid API Key Error

Symptoms:

  • HTTP 401 Unauthorized responses
  • Error message: "Unauthenticated" or "Invalid API key"

Diagnostic Steps:

StepActionExpected Result
1Verify API key formatShould start with pk_test_ or pk_live_
2Check key lengthShould be 64+ characters
3Verify Authorization headerFormat: Bearer pk_live_...
4Test key in dashboardKey should appear in API Keys list

Solutions:

CauseSolution
Incorrect key formatCopy key exactly from dashboard
Deleted or expired keyGenerate new API key
Wrong environmentUse test key for development, live key for production
Missing Bearer prefixInclude Bearer before the API key

Rate Limiting

Symptoms:

  • HTTP 429 Too Many Requests
  • X-RateLimit-Remaining: 0 header

Rate Limits by Plan:

PlanRequests/MinuteBurst LimitRecommended Action
Free10020Implement request queuing
Starter30060Use exponential backoff
Professional1,000200Monitor usage patterns
EnterpriseCustomCustomContact support for adjustment

Implementation:

async function makeApiRequestWithBackoff(url, options, maxRetries = 3) {
  for (let attempt = 1; attempt <= maxRetries; attempt++) {
    try {
      const response = await fetch(url, options);
      
      if (response.status === 429) {
        const retryAfter = parseInt(response.headers.get('Retry-After')) || Math.pow(2, attempt);
        await new Promise(resolve => setTimeout(resolve, retryAfter * 1000));
        continue;
      }
      
      return response;
    } catch (error) {
      if (attempt === maxRetries) throw error;
      await new Promise(resolve => setTimeout(resolve, Math.pow(2, attempt) * 1000));
    }
  }
}

Message Delivery Problems

Message Stuck in "Queued" Status

Diagnostic Steps:

CheckCommandWhat to Look For
Partner statusGET /v1/partners/{id}active: true
Partner URLTest endpoint manuallyHTTPS accessibility
CertificatesGET /v1/certificatesValid, non-expired certificates
Message logsDashboard → Messages → View DetailsSpecific error messages

Common Causes:

IssueSymptomsSolution
Partner endpoint downConnection timeoutsContact partner to verify endpoint
Invalid certificatesCertificate validation errorsUpload valid certificates
Network connectivityDNS or connection failuresVerify firewall and network settings
Partner configurationAS2 ID mismatchVerify AS2 identifiers match

MDN Not Received

Diagnostic Checklist:

ItemCheckResolution
MDN modePartner configuration shows async or syncSet appropriate MDN mode
Partner MDN supportPartner supports MDN responsesConfirm with partner
MDN endpointPartner can reach your MDN endpointProvide correct MDN URL
Certificate for MDN signingValid signing certificate configuredUpload/renew signing certificate

MDN Troubleshooting:

# Check message MDN status
GET /v1/messages/{message_id}

# Look for mdn_status field:
# - "pending": MDN requested but not received
# - "received": MDN successfully received  
# - "failed": MDN delivery failed
# - "timeout": MDN not received within timeout

Partner Configuration Issues

Partner Connection Test Failures

Test Types and Common Failures:

Test TypeCommon FailuresDiagnostic Actions
pingDNS resolution, connection timeoutVerify URL, check network connectivity
mdnMDN endpoint unreachableVerify partner's MDN endpoint configuration
fullAS2 protocol errorsCheck AS2 ID configuration, certificates

Connection Test Response Analysis:

{
  "success": false,
  "results": {
    "connectivity": "failed",
    "error": "Connection timeout"
  },
  "timeline": [
    {
      "step": "DNS resolution",
      "status": "success",
      "duration_ms": 15
    },
    {
      "step": "TCP connection", 
      "status": "failure",
      "duration_ms": 60000,
      "details": "Connection timeout after 60 seconds"
    }
  ]
}

AS2 ID Configuration Problems

Validation Rules:

RuleSpecificationInvalid ExamplesValid Examples
Character setAlphanumeric, hyphens, underscoresACME CORP (space)ACME-CORP-AS2
Length1-50 charactersA (too short for some systems)ACME-CORPORATION-AS2
Case sensitivityExact match requiredacme-corp vs ACME-CORPUse consistent casing
UniquenessMust be unique per tenantDuplicate AS2 IDsEach partner needs unique ID

Certificate Problems

Certificate Upload Failures

Common Certificate Issues:

ErrorCauseSolution
INVALID_FORMATUnsupported certificate formatConvert to PEM format
EXPIRED_CERTIFICATECertificate past expiration dateObtain new certificate
INVALID_KEY_USAGECertificate lacks required key usageUse certificate with correct key usage
PRIVATE_KEY_MISMATCHPrivate key doesn't match certificateVerify key pair correspondence
INCOMPLETE_CHAINMissing intermediate certificatesInclude full certificate chain

Certificate Format Requirements:

FormatFile ExtensionUsageNotes
PEM.pem, .crtPreferredBase64 encoded with headers
DER.der, .cerSupportedBinary format
PKCS#12.p12, .pfxIdentity certificatesIncludes private key

Certificate Validation

Validation Process:

POST /v1/certificates/{id}/validate

Validation Checks:

CheckDescriptionFailure Resolution
Format validationCertificate structure and encodingRe-export certificate in correct format
Expiry checkCertificate validity periodRenew certificate before expiration
Key usage validationCertificate supports required operationsUse certificate with correct key usage extensions
Chain validationCertificate chain completenessInclude intermediate CA certificates

Webhook Delivery Issues

Webhook Endpoint Not Receiving Events

Diagnostic Steps:

StepCheckTool
1Endpoint accessibilitycurl -X POST https://your-endpoint.com/webhooks
2SSL certificate validityBrowser or SSL checker
3Response timeShould respond within 10 seconds
4Response statusMust return 2xx status code
5Webhook configurationVerify events and URL in dashboard

Webhook Requirements:

RequirementSpecificationNotes
ProtocolHTTPS onlyHTTP endpoints not supported
Response time< 10 secondsLonger responses treated as timeout
Status codes2xx rangeAny non-2xx triggers retry
Content typeAccept application/jsonWebhook payloads are JSON

Webhook Signature Verification

Signature Verification Implementation:

const crypto = require('crypto');

function verifyWebhookSignature(payload, signature, secret) {
  const expectedSignature = crypto
    .createHmac('sha256', secret)
    .update(payload, 'utf8')
    .digest('hex');
  
  return crypto.timingSafeEqual(
    Buffer.from(signature.replace('sha256=', ''), 'hex'),
    Buffer.from(expectedSignature, 'hex')
  );
}

Common Signature Issues:

IssueCauseSolution
Signature mismatchIncorrect secret or payloadVerify webhook secret in dashboard
Missing signature headerHeader not included in requestCheck for X-Signature header
Encoding problemsPayload encoding mismatchUse raw request body for verification

Performance Issues

Slow API Responses

Performance Optimization:

IssueCauseSolution
Large response payloadsRequesting too much dataUse pagination and filtering
Inefficient queriesFetching unnecessary dataRequest only required fields
Network latencyGeographic distanceConsider regional endpoints
Concurrent request limitsToo many simultaneous requestsImplement request queuing

Optimal Request Patterns:

PatternImplementationBenefit
PaginationUse appropriate per_page valuesFaster response times
FilteringApply specific filtersReduced data transfer
CachingCache stable data locallyFewer API requests
Batch operationsGroup related operationsImproved efficiency

Message Processing Delays

Processing Time Factors:

FactorImpactOptimization
Message sizeLinear increaseEnable compression
EncryptionModerate increaseUse efficient algorithms
Partner response timeVariableMonitor partner performance
Network conditionsVariableImplement retry logic

Getting Support

Self-Service Resources

ResourceURLUse Case
System Statushttps://status.as2aas.comCheck for known issues
Dashboard LogsDashboard → Messages → DetailsView specific error messages
Testing ToolsDashboard → Testing ToolsReproduce issues safely
API Documentationhttps://docs.as2aas.comVerify API usage

Information to Include When Contacting Support

For Message Issues

  • Message ID
  • Partner ID
  • Timestamp of issue
  • Error message or status
  • Expected vs actual behavior

For Partner Issues

  • Partner ID
  • AS2 ID
  • Partner endpoint URL
  • Connection test results
  • Certificate information

For API Issues

  • HTTP status code
  • Complete error response
  • Request details (without sensitive data)
  • API key prefix (not full key)
  • Timestamp of request

Support Channels

ChannelResponse TimeUse Case
Email ([email protected])4-24 hoursGeneral support questions
Enterprise Support2-4 hoursPaid plan customers
Emergency ([email protected])15 minutesProduction outages (Enterprise only)

Escalation Process

  1. Self-service - Check documentation and status page
  2. Dashboard tools - Use testing and diagnostic tools
  3. Email support - Provide detailed issue description
  4. Phone support - Enterprise customers for urgent issues
  5. Emergency escalation - Production-critical issues only

Diagnostic Commands

Quick Health Check

# Test API connectivity
curl -H "Authorization: Bearer pk_test_your_key" \
     https://api.as2aas.com/v1/partners

# Check specific partner
curl -H "Authorization: Bearer pk_test_your_key" \
     https://api.as2aas.com/v1/partners/prt_000001

# Test partner connection
curl -X POST \
     -H "Authorization: Bearer pk_test_your_key" \
     -H "Content-Type: application/json" \
     -d '{"test_type": "ping"}' \
     https://api.as2aas.com/v1/partners/prt_000001/test

Message Debugging

# Get message details
curl -H "Authorization: Bearer pk_test_your_key" \
     https://api.as2aas.com/v1/messages/msg_000001

# Check recent messages
curl -H "Authorization: Bearer pk_test_your_key" \
     "https://api.as2aas.com/v1/messages?per_page=5&sort=created_at:desc"

Certificate Validation

# List certificates with expiry information
curl -H "Authorization: Bearer pk_test_your_key" \
     https://api.as2aas.com/v1/certificates

# Validate specific certificate
curl -X POST \
     -H "Authorization: Bearer pk_test_your_key" \
     https://api.as2aas.com/v1/certificates/cert_000001/validate