Skip to main content

Authentication Guide

Learn how to authenticate and authorize requests to the Dodgeprint API.

Overview

Dodgeprint API uses JWT (JSON Web Tokens) for authentication. All API requests must include:

  • Authorization header with Bearer token
  • X-Workspace-Id header for workspace context

Getting Your API Token

To authenticate with the Dodgeprint API, you need to generate a Personal Access Token from your account dashboard. Personal Access Tokens are long-lived tokens ideal for integrations and automation.

Steps to Generate Token

  1. Log in to Dashboard

  2. Generate New Token

    • Click "Generate New Token" or "Create Access Token"
    • Give your token a descriptive name (e.g., Production API, Integration Token)
    • Choose an expiration period or select "No Expiration" for long-term use
  3. Copy and Save Token

    eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...
    Important: Save Your Token Securely

    Copy and save this token immediately. For security reasons, you won't be able to see it again after leaving this page. If you lose it, you'll need to generate a new token.

Alternative Access

You can also access the API settings from the main dashboard:

  • Go to SettingsDeveloperAPI Access

Finding Your Workspace ID

Every API request requires a X-Workspace-Id header. Here's how to find it:

Method 1: From Dashboard URL

When you're logged into the dashboard, check the URL:

https://app.dodgeprint.com/workspace/359/dashboard
^^^
This is your workspace_id

Method 2: From API

curl -X GET "https://api.dodgeprint.com/api/v1/workspaces" \
-H "Authorization: Bearer YOUR_TOKEN"

Response:

{
"success": true,
"data": [
{
"id": 359,
"name": "My Workspace",
"role": "owner"
}
]
}

Making Authenticated Requests

Required Headers

Every API request must include these headers:

-H "Authorization: Bearer YOUR_TOKEN"
-H "X-Workspace-Id: YOUR_WORKSPACE_ID"
-H "Content-Type: application/json"

Complete Example

curl -X GET "https://api.dodgeprint.com/api/v1/products" \
-H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..." \
-H "X-Workspace-Id: 359" \
-H "Content-Type: application/json"

Token Best Practices

✅ Do

  • Store tokens securely (environment variables, secret managers)
  • Use HTTPS in production
  • Set appropriate token expiration
  • Rotate tokens periodically
  • Use different tokens for different environments (dev, staging, prod)

❌ Don't

  • Commit tokens to version control
  • Share tokens between team members
  • Use production tokens in development
  • Store tokens in client-side code
  • Include tokens in URLs or logs

Environment Variables

Store your credentials in environment variables:

Bash/Linux

export DODGEPRINT_TOKEN="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..."
export DODGEPRINT_WORKSPACE_ID="359"

.env File

DODGEPRINT_TOKEN=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...
DODGEPRINT_WORKSPACE_ID=359
DODGEPRINT_API_URL=https://api.dodgeprint.com/api/v1

Usage in cURL

curl -X GET "$DODGEPRINT_API_URL/products" \
-H "Authorization: Bearer $DODGEPRINT_TOKEN" \
-H "X-Workspace-Id: $DODGEPRINT_WORKSPACE_ID"

Error Handling

401 Unauthorized

Cause: Invalid or expired token

{
"success": false,
"code": 401,
"message": "Unauthenticated"
}

Solution:

  • Verify token is correct
  • Check token hasn't expired
  • Regenerate token if needed

403 Forbidden

Cause: Invalid workspace ID or insufficient permissions

{
"success": false,
"code": 403,
"message": "Invalid workspace or access denied"
}

Solution:

  • Verify X-Workspace-Id is correct
  • Check you have access to this workspace
  • Verify workspace owns the resource you're accessing

Testing Your Authentication

Use this simple test to verify your credentials:

curl -X GET "https://api.dodgeprint.com/api/v1/user" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Workspace-Id: YOUR_WORKSPACE_ID"

Success Response:

{
"success": true,
"data": {
"id": 10062,
"email": "[email protected]",
"name": "John Doe",
"workspace": {
"id": 359,
"name": "My Workspace",
"role": "owner"
}
}
}

Next Steps


Need Help?

If you have authentication issues: