return to Table of Contents, API

/projects/:document_identifier/address-groups/:address_group_uuid

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

URL Parameters

Label Description
:document_identifier The project's document identifier
:address_group_uuid The UUID of the address group

GET

Returns information about the group.

Request Query String Parameters

Name Required Description
fields No A comma-separated list of the keys you want returned for the group. 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 message.

Key Value Description
uuid String The UUID of the group
date_created String The date and time the message was created, in ISO 8601 format
name String The name of the group
blacklist Boolean True if the group is a blacklist
number_of_addresses Integer The number of addresses in the group
links Array of Object URLs for the address group (rel:self) and its addresses (rel:addresses)

Example

GET /api/v2/projects/187812f26ba37d9769d8691d2a83c95c/address-groups/547ADAA7-0DBC-43B5-913B-AE05EC621284 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 22:03:27 GMT
Content-Type: application/json; charset=utf-8
Access-Control-Allow-Origin: *

{
    "blacklist": false,
    "date_created": "2015-04-22T16:35:27+0000",
    "links": [
        {
            "href": "https://secure.directmailmac.com/api/v2/projects/187812f26ba37d9769d8691d2a83c95c/address-groups/547ADAA7-0DBC-43B5-913B-AE05EC621284",
            "rel": "self"
        },
        {
            "href": "https://secure.directmailmac.com/api/v2/projects/187812f26ba37d9769d8691d2a83c95c/address-groups/547ADAA7-0DBC-43B5-913B-AE05EC621284/addresses",
            "rel": "addresses"
        }
    ],
    "name": "Mailing List",
    "number_of_addresses": 2,
    "uuid": "547ADAA7-0DBC-43B5-913B-AE05EC621284"
}

PATCH

Updates the address group.

Request Body

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

Key Required Value Description
name No String The name of the group
blacklist No Boolean True if the group is blacklist

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 address group 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/address-groups/547ADAA7-0DBC-43B5-913B-AE05EC621284 HTTP/1.1
Authorization: Basic QzFENDREMjEtNTA4MC00NTM3LUFFOD
Content-Type: application/json; charset=utf-8
Host: secure.directmailmac.com
Connection: close

{
    "name": "New Group Name"
}

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

{
    "links": [
        {
            "href": "https://secure.directmailmac.com/api/v2/projects/187812f26ba37d9769d8691d2a83c95c/merge-task?s=43&m=PATCH&r=https%3A%2F%2Fsecure.directmailmac.com%2Fapi%2Fv2%2Fprojects%2F187812f26ba37d9769d8691d2a83c95c%2Faddress-groups%2F547ADAA7-0DBC-43B5-913B-AE05EC621284",
            "rel": "merge-task"
        },
        {
            "href": "https://secure.directmailmac.com/api/v2/projects/187812f26ba37d9769d8691d2a83c95c/address-groups/547ADAA7-0DBC-43B5-913B-AE05EC621284",
            "rel": "resource"
        }
    ]
}

DELETE

Deletes the address group.

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 address group 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/address-groups/547ADAA7-0DBC-43B5-913B-AE05EC621284 HTTP/1.1
Authorization: Basic QzFENDREMjEtNTA4MC00NTM3LUFFOD
Host: secure.directmailmac.com

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

{
    "links": [
        {
            "href": "https://secure.directmailmac.com/api/v2/projects/187812f26ba37d9769d8691d2a83c95c/merge-task?s=44&m=DELETE&r=https%3A%2F%2Fsecure.directmailmac.com%2Fapi%2Fv2%2Fprojects%2F187812f26ba37d9769d8691d2a83c95c%2Faddress-groups%2F547ADAA7-0DBC-43B5-913B-AE05EC621284",
            "rel": "merge-task"
        }
    ]
}

Did you find this article helpful? Yes | No