return to Table of Contents, API

/projects/:document_identifier/messages/:message_uuid/headers/:header_uuid

This resource supports the GET, PATCH, and DELETE methods.

URL Parameters

Label Description
:document_identifier The project's document identifier
:message_uuid The UUID of the message
:header_uuid The UUID of the header

GET

Returns information about the header.

Request Query String Parameters

Name Required Description
fields No A comma-separated list of the keys you want returned for the header. Default is to return all keys.

Response Status Codes

Code Description
503 Service Unavailable Server is undergoing maintenance and is unavailable
429 Rate Limited Rate limiting in effect, try again later
404 Not Found The resource could not be found or your API key has not been granted access to it
403 Forbidden Direct Mail account is disabled
401 Unauthorized API key, secret, or authentication method is incorrect
200 OK Success

Response Body

A JSON object representing the header.

Key Value Description
uuid String The UUID of the header
field String The header field (e.g. "Cc", "Reply-To", etc.)
value String The header value
links Array of Object URL for the header (rel:self)

Example

GET /api/v2/projects/187812f26ba37d9769d8691d2a83c95c/messages/F7ADD5FB-6AB3-49A7-AA2B-233A7C750FE7/headers/4AC4B981-6D2A-44C2-8636-B848472879A4 HTTP/1.1
Authorization: Basic QzFENDREMjEtNTA4MC00NTM3LUFFOD
Accept: application/json; charset=utf-8
Host: secure.directmailmac.com

HTTP/1.1 200 OK
Date: Wed, 22 Apr 2015 20:50:58 GMT
Content-Type: application/json; charset=utf-8

{
    "field": "Cc",
    "links": [
        {
            "href": "https://secure.directmailmac.com/api/v2/projects/187812f26ba37d9769d8691d2a83c95c/messages/F7ADD5FB-6AB3-49A7-AA2B-233A7C750FE7/headers/4AC4B981-6D2A-44C2-8636-B848472879A4",
            "rel": "self"
        }
    ],
    "uuid": "4AC4B981-6D2A-44C2-8636-B848472879A4",
    "value": "test-cc@example.com"
}

PATCH

Updates the header.

Request Body

A JSON object representing the properties you want to update. You may update the following keys:

Key Required Value Description
field No String The header field (e.g. "Cc", "Reply-To", etc.)
value No String The header value

Response Status Codes

Code Description
503 Service Unavailable Server is undergoing maintenance and is unavailable
429 Rate Limited Rate limiting in effect, try again later
404 Not Found The project could not be found
403 Forbidden Direct Mail account is disabled or the message is not editable
401 Unauthorized API key, secret, or authentication method is incorrect
400 Bad Request One or more of the values in the request body is invalid
202 Accepted The request has been accepted for processing

Response Body

A JSON object representing the merge task.

Key Value Description
links Array of Object URLs for the merge task and the updated resource.

Example

PATCH /api/v2/projects/187812f26ba37d9769d8691d2a83c95c/messages/F7ADD5FB-6AB3-49A7-AA2B-233A7C750FE7/headers/4AC4B981-6D2A-44C2-8636-B848472879A4 HTTP/1.1
Authorization: Basic QzFENDREMjEtNTA4MC00NTM3LUFFOD
Content-Type: application/json; charset=utf-8
Host: secure.directmailmac.com
Content-Length: 55

{
    "value": "test-cc-1@example.com,test-cc-2@example.com"
}

HTTP/1.1 202 Accepted
Date: Wed, 22 Apr 2015 20:53:35 GMT
Content-Type: application/json; charset=utf-8

{
    "links": [
        {
            "href": "https://secure.directmailmac.com/api/v2/projects/187812f26ba37d9769d8691d2a83c95c/merge-task?s=32&m=PATCH&r=https%3A%2F%2Fsecure.directmailmac.com%2Fapi%2Fv2%2Fprojects%2F187812f26ba37d9769d8691d2a83c95c%2Fmessages%2FF7ADD5FB-6AB3-49A7-AA2B-233A7C750FE7%2Fheaders%2F4AC4B981-6D2A-44C2-8636-B848472879A4",
            "rel": "merge-task"
        },
        {
            "href": "https://secure.directmailmac.com/api/v2/projects/187812f26ba37d9769d8691d2a83c95c/messages/F7ADD5FB-6AB3-49A7-AA2B-233A7C750FE7/headers/4AC4B981-6D2A-44C2-8636-B848472879A4",
            "rel": "resource"
        }
    ]
}

DELETE

Deletes the header.

Response Status Codes

Code Description
503 Service Unavailable Server is undergoing maintenance and is unavailable
429 Rate Limited Rate limiting in effect, try again later
404 Not Found The project could not be found
403 Forbidden Direct Mail account is disabled or the message is not editable
401 Unauthorized API key, secret, or authentication method is incorrect
400 Bad Request One or more of the values in the request body is invalid
202 Accepted The request has been accepted for processing

Response Body

A JSON object representing the merge task.

Key Value Description
links Array of Object URL for the merge task.

Example

DELETE /api/v2/projects/187812f26ba37d9769d8691d2a83c95c/messages/F7ADD5FB-6AB3-49A7-AA2B-233A7C750FE7/headers/4AC4B981-6D2A-44C2-8636-B848472879A4 HTTP/1.1
Authorization: Basic QzFENDREMjEtNTA4MC00NTM3LUFFOD
Host: secure.directmailmac.com

HTTP/1.1 202 Accepted
Date: Wed, 22 Apr 2015 20:54:32 GMT
Content-Type: application/json; charset=utf-8

{
    "links": [
        {
            "href": "https://secure.directmailmac.com/api/v2/projects/187812f26ba37d9769d8691d2a83c95c/merge-task?s=33&m=DELETE&r=https%3A%2F%2Fsecure.directmailmac.com%2Fapi%2Fv2%2Fprojects%2F187812f26ba37d9769d8691d2a83c95c%2Fmessages%2FF7ADD5FB-6AB3-49A7-AA2B-233A7C750FE7%2Fheaders%2F4AC4B981-6D2A-44C2-8636-B848472879A4",
            "rel": "merge-task"
        }
    ]
}

Did you find this article helpful? Yes | No