POST api/WaybillEmailCreation
Sends the Full New Waybill HTML waybill copy to a specified receiver.
Request Information
URI Parameters
None.
Body Parameters
WaybillEmailCreationRequest| Name | Description | Type | Additional information |
|---|---|---|---|
| ReceiverEmailAddress |
Single receiver email address, without a display name. |
string |
Required String length: inclusive between 0 and 254 |
| AccNr |
Account number belonging to the saved waybill. |
string |
Required String length: inclusive between 0 and 100 |
| WaybillNumber |
Existing, non-deleted DCB Online waybill number. |
string |
Required String length: inclusive between 0 and 100 |
Request Formats
application/json
{"ReceiverEmailAddress":"receiver@example.com","AccNr":"ACC001","WaybillNumber":"DCB000123456"}
text/json
{
"ReceiverEmailAddress": "sample string 1",
"AccNr": "sample string 2",
"WaybillNumber": "sample string 3"
}
application/xml, text/xml
<WaybillEmailCreationRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/DCB_API"> <AccNr>sample string 2</AccNr> <ReceiverEmailAddress>sample string 1</ReceiverEmailAddress> <WaybillNumber>sample string 3</WaybillNumber> </WaybillEmailCreationRequest>
application/x-www-form-urlencoded
Response Information
Resource Description
IHttpActionResultNone.
Response Formats
application/json
{"success":true,"message":"Waybill email accepted by SMTP.","waybillNumber":"DCB000123456"}
text/json, application/xml, text/xml
Sample not available.
Waybill Email Copy
Send an existing DCB Online waybill to the receiver using the Full New Waybill HTML email copy. This operation does not create or modify a waybill.
Required Header
X-FreightWare: <session-token>
The header follows the existing secure-link endpoints' presence check. Account matching validates the supplied account/waybill pair; existing trusted API access controls still apply.
Request Validation
| Field | Required | Validation |
|---|---|---|
| ReceiverEmailAddress | Yes | One valid email address, maximum 254 characters. No display name, address lists or control characters. |
| AccNr | Yes | Non-blank account number, maximum 100 characters. Must match the waybill account. |
| WaybillNumber | Yes | Non-blank existing, non-deleted waybill number, maximum 100 characters. |
Identifier control characters are rejected. Leading and trailing spaces are trimmed after model validation. A missing waybill and an account mismatch return the same 404 response.
Success Response - HTTP 200
{
"success": true,
"message": "Waybill email accepted by SMTP.",
"waybillNumber": "DCB000123456"
}
Success means SMTP accepted the message; it does not guarantee inbox delivery.
Error Response Example - HTTP 404
{
"success": false,
"code": "WAYBILL_NOT_FOUND",
"message": "No waybill found for the supplied account and waybill number."
}
Errors
| HTTP | Code | Meaning |
|---|---|---|
| 400 | INVALID_REQUEST | Missing or malformed JSON, missing fields, excess length, invalid email at model validation, or invalid identifiers. |
| 400 | INVALID_EMAIL | The receiver must be one valid email address without a display name. |
| 401 | AUTH_HEADER_REQUIRED | X-FreightWare is missing or blank. |
| 404 | WAYBILL_NOT_FOUND | No non-deleted waybill matches the supplied account and number. |
| 502 | EMAIL_SEND_FAILED | SMTP rejected or could not confirm acceptance. Check delivery before retrying. |
| 500 | EMAIL_CONFIGURATION_ERROR | Email configuration is unavailable. Contact support. |
| 500 | INTERNAL_ERROR | Database or other processing failure. Contact support. |
Application errors return success, code and message. Framework errors such as unsupported media type (415) use the standard Web API response format.
Email Content and Delivery
The subject is Waybill Copy - <number>. The HTML includes waybill, consignor, consignee, invoice, insurance and parcel details, the tracking link, SWAD disclaimer and terms link. The original Full New Waybill copy has no attachments.
Uses DCB Logistics System <no-reply@dcb.co.za>, Office 365 SMTP on port 587 with TLS and the existing mailbox settings. Each successful request sends one email. Repeated calls can send duplicates; there is no automatic retry.