DM Web Services Documentation

Authentication Guide

DM Web Services uses a custom signed Bearer token for authentication. This page explains how to obtain a token, how to include it correctly in REST and SOAP requests, and what to expect when authentication fails.


Token Format

Tokens are issued and managed exclusively by DM. They are not base64-encoded usernames and passwords. The token is a custom signed structure with an embedded expiry and scope. You cannot generate or refresh a token yourself.

  • Tokens are provisioned by your DM integration coordinator.
  • Each token is scoped to specific clients, carriers, and operations.
  • If a token expires or is revoked, all requests return HTTP 401 until a new token is issued.
  • Contact your DM administrator to obtain or renew a token.

REST Authentication

Include your token in the Authorization HTTP header on every authenticated request.

Header Format

Authorization: Bearer {YOUR_TOKEN}

Full curl Example

curl -X POST {BASE_URL}/api/public/v1/shipping/CreateShipment \
  -H "Authorization: Bearer {YOUR_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

REST 401 Response

Authentication failure returns HTTP 401 with no body. There is no JSON error object for auth failures.

HTTP/1.1 401 Unauthorized

SOAP Authentication

Important: Authentication for SOAP requests uses the same HTTP Authorization header as REST. Do not use a SOAP <Security> header element or WS-Security -- these are not supported and will be ignored.

HTTP Header (apply to the SOAP HTTP request)

Authorization: Bearer {YOUR_TOKEN}

SoapUI Configuration

In SoapUI, add the Authorization header under the request's Headers tab, not the Auth tab:

  1. Open your request in SoapUI
  2. Click the Headers tab at the bottom of the request panel
  3. Add a new header: Name = Authorization, Value = Bearer {YOUR_TOKEN}

SOAP Envelope (no auth element needed)

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
  <soapenv:Header/>
  <soapenv:Body>
    <Ping xmlns="http://dmwebservices.com/shipping/public/v1"/>
  </soapenv:Body>
</soapenv:Envelope>

SOAP 401 Response

A missing or invalid token returns HTTP 401 at the transport level. The SOAP body is not reached.

HTTP/1.1 401 Unauthorized

Which Endpoints Require Authentication

EndpointAuth Required
GET .../pingNo
GET .../healthNo
GET .../versionNo
SOAP Ping()No
POST .../CreateShipmentYes
POST .../BookLastMileYes
POST .../UpdateShipmentYes
All SOAP shipping operationsYes
All Client/Beyond operationsYes

Troubleshooting 401 Errors

SymptomLikely Cause
All requests return 401Token is missing, expired, or revoked -- contact DM
Ping works, shipping calls return 401Token is present but malformed in the header -- verify no extra whitespace or line breaks
SOAP returns 401, REST worksToken is being placed in SOAP header instead of HTTP header
Intermittent 401Token nearing expiry -- request a renewal from DM

Related Resources