/message_types
Use this resource to view and create new Message Types. Message Types are a way to add metadata to Email Messages and Email Templates. The Message Type will be stored with every recipient. If the Message does not have a Message Type, the Message Template’s Message Type will be used, if it exists. A GovDelivery Communication Cloud admin can use this metadata to build Segments that contain Subscribers that received a Transactional Email with a particular Message Type.
A Message Type has two fields: code and label. The code is used as a unique identifier and the label is used as human readable description.
{
"code": "salutations",
"label": "Greetings and Salutations"
}
Lists your Message Types
Responses with more than 50 records will be paginated to 50 records per response, unless otherwise specified.
Headers
Name | Required | Type | Description |
---|---|---|---|
X-AUTH-TOKEN | * | string |
An authentication token provided to you by GovDelivery. |
Headers
Name | Type | Description |
---|---|---|
Link | string |
Appropriate pagination link relations. Can include “first”, “last”, “prev”, and “next” relations. Example
|
Body
Example
[
{
"code": "salutations",
"label": "Greetings and Salutations",
"_links": {
"self": "/message_types/21768"
}
}
]
Schema
Name | Type | Description |
---|---|---|
code | string |
The unique identifier Example
|
label | string |
Human readable description. Example
|
_links | object |
An object that defines links to related objects. Properties
|
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Message_Types",
"description": "Create a new message_type to have TMS add metadata to recipients",
"type": "array",
"items": {
"title": "Message_Type",
"type": "object",
"properties": {
"code": {
"description": "The unique identifier",
"type": "string",
"example": "salutations"
},
"label": {
"description": "Human readable description.",
"type": "string",
"example": "Greetings and Salutations"
},
"_links": {
"title": "Relational Links",
"description": "An object that defines links to related objects.",
"type": "object",
"properties": {
"self": {
"description": "Relative URI of the object",
"type": "string",
"example": "/message_types/10040"
}
}
}
}
}
}
Body
Example
{
"error": "Invalid authentication token"
}
Create a new message_type to attach to email message recipients.
Headers
Name | Required | Type | Description |
---|---|---|---|
X-AUTH-TOKEN | * | string |
An authentication token provided to you by GovDelivery. |
Body
Example
{
"code": "salutations",
"label": "Greetings and Salutations"
}
Schema
Name | Required | Type | Description |
---|---|---|---|
code | * | string |
The unique identifier Example
|
label | * | string |
Human readable description Example
|
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "/message_types",
"description": "Create a new message_type to attach to email message recipients.\n",
"type": "object",
"properties": {
"code": {
"description": "The unique identifier\n",
"type": "string",
"example": "salutations"
},
"label": {
"description": "Human readable description\n",
"type": "string",
"example": "Greetings and Salutations"
}
},
"required": [
"code",
"label"
]
}
Form Parameters
Name | Required | Type | Description |
---|---|---|---|
code | * | string |
The unique identifier Example
|
label | * | string |
Human readable description Example
|
Body
Example
{
"code": "salutations",
"label": "Greetings and Salutations",
"_links": {
"self": "/message_type/21768"
}
}
Description
Unprocessable Entity
Body
Example
{
"code": "something_else",
"label": "Greetings and Salutations",
"errors":{
"code":[
"can't be changed"
]
}
}
Body
Example
{
"error": "Invalid authentication token"
}