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
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:
- Open your request in SoapUI
- Click the Headers tab at the bottom of the request panel
- 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
| Endpoint | Auth Required |
|---|---|
GET .../ping | No |
GET .../health | No |
GET .../version | No |
SOAP Ping() | No |
POST .../CreateShipment | Yes |
POST .../BookLastMile | Yes |
POST .../UpdateShipment | Yes |
| All SOAP shipping operations | Yes |
| All Client/Beyond operations | Yes |
Troubleshooting 401 Errors
| Symptom | Likely Cause |
|---|---|
| All requests return 401 | Token is missing, expired, or revoked -- contact DM |
| Ping works, shipping calls return 401 | Token is present but malformed in the header -- verify no extra whitespace or line breaks |
| SOAP returns 401, REST works | Token is being placed in SOAP header instead of HTTP header |
| Intermittent 401 | Token nearing expiry -- request a renewal from DM |