Documentazione di aiuto 〉API 〉

/projects/:document_identifier

Spiacenti, questo articolo di supporto non è al momento tradotto in italiano. Se lo desideri, puoi provare una traduzione basata su Google.

This resource supports the GET and PATCH methods.

URL Parameters

Label Description
:document_identifier The project's document identifier

GET

Returns information about the project, including links to subresources such as messages, address groups, and campaign reports.

GET Request Query String Parameters

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

GET 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 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

GET Response Body

A JSON object representing the project.

Key Value Description
document_identifier String The project's document identifier
name String The name of the project
address_custom_column_names Array of String An array of 15 strings specifying the custom column names (e.g. "Custom 1", "Custom 2", etc.)
locale_identifier String The locale identifier for the project's locale. The locale is used for formatting dates and numbers when merging and sending email.
time_zone_name String One of the recognized time zone IDs from the IANA time zone database. Timezones are used when merging mail-merge tags, interpreting dates in address custom columns, and performing date calculations in smart groups and autoresponders.
number_of_messages Integer The number of messages in the project
number_of_address_groups Integer The number of address groups in the project
number_of_reports Integer The number of reports in the project
number_of_webhooks Integer The number of webhooks in the project
links Array of Object URLs for the project (rel:self), messages (rel:messages), address groups (rel:address-groups), campaign reports (rel:reports), and webhooks (rel:webhooks).

GET Example

GET /api/v2/projects/187812f26ba37d9769d8691d2a83c95c 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 17:03:31 GMT
Content-Type: application/json; charset=utf-8

{
    "document_identifier": "187812f26ba37d9769d8691d2a83c95c",
    "name": "API Test Project",
    "address_custom_column_names": [
        "Custom 1",
        "Custom 2",
        "Custom 3",
        "Custom 4",
        "Custom 5",
        "Custom 6",
        "Custom 7",
        "Custom 8",
        "Custom 9",
        "Custom 10",
        "Custom 11",
        "Custom 12",
        "Custom 13",
        "Custom 14",
        "Custom 15"
    ],
    "number_of_messages": 17,
    "number_of_address_groups": 3,
    "number_of_reports": 6,
    "number_of_webhooks": 5,
    "links": [
        {
            "href": "https://secure.directmailmac.com/api/v2/projects/187812f26ba37d9769d8691d2a83c95c/messages",
            "rel": "messages"
        },
        {
            "href": "https://secure.directmailmac.com/api/v2/projects/187812f26ba37d9769d8691d2a83c95c/address-groups",
            "rel": "address-groups"
        },
        {
            "href": "https://secure.directmailmac.com/api/v2/projects/187812f26ba37d9769d8691d2a83c95c/reports",
            "rel": "reports"
        }
        {
            "href": "https://secure.directmailmac.com/api/v2/projects/187812f26ba37d9769d8691d2a83c95c/webhooks",
            "rel": "webhooks"
        }
    ],
    "locale_identifier": "en_US",
    "time_zone_name": "America/Los_Angeles"
}

PATCH

Updates properties of the project.

PATCH Request Body

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

Key Required Value Description
name No String The name of the project. Cannot contain the ":" or newline characters.
address_custom_column_names No Array of String An array of 15 strings specifying the custom column names (e.g. "Custom 1", "Custom 2", etc.)
locale_identifier No String The locale identifier for the project's locale. The locale is used for formatting dates and numbers when merging and sending email. The identifier should conform to IETF’s BCP 47.
time_zone_name No String One of the recognized time zone IDs from the IANA time zone database. Timezones are used when merging mail-merge tags, interpreting dates in address custom columns, and performing date calculations in smart groups and autoresponders.

PATCH 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
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

PATCH 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.

PATCH Example

PATCH /api/v2/projects/187812f26ba37d9769d8691d2a83c95c HTTP/1.1
Authorization: Basic QzFENDREMjEtNTA4MC00NTM3LUFFOD
Content-Type: application/json; charset=utf-8
Host: secure.directmailmac.com
Content-Length: 189

{
    "address_custom_column_names": [
        "Age",
        "Gender",
        "City",
        "State",
        "Country",
        "Custom 6",
        "Custom 7",
        "Custom 8",
        "Custom 9",
        "Custom 10",
        "Custom 11",
        "Custom 12",
        "Custom 13",
        "Custom 14",
        "Custom 15"
    ]
}

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

{
    "links": [
        {
            "href": "https://secure.directmailmac.com/api/v2/projects/187812f26ba37d9769d8691d2a83c95c/merge-task?s=11&m=PATCH&r=https%3A%2F%2Fsecure.directmailmac.com%2Fapi%2Fv2%2Fprojects%2F187812f26ba37d9769d8691d2a83c95c",
            "rel": "merge-task"
        },
        {
            "href": "https://secure.directmailmac.com/api/v2/projects/187812f26ba37d9769d8691d2a83c95c",
            "rel": "resource"
        }
    ]
}

Hai trovato utile questo articolo? | No