V3 REFERENCE Campaigns

/campaigndraft

CampaignDraft data. Newsletter and CampaignDraft objects are differentiated by the EditMode values.

List campaigndraft resources available for this apikey, use a GET request. Alternatively, you may want to add one or more filters.

# list campaigndraft resources

curl -s -X GET \
--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
https://api.mailjet.com/v3/REST/campaigndraft
Properties
Name Description
AXFractionName Fraction of AXTesting in percentage. Zero means remainder
  • [ Type AnsiString ]
AXTesting A reference to AXTesting object
  • [ Type TAXTesting ]
CampaignID
OR
CampaignALT
CampaignID
ID reference to Campaign
CampaignALT
Value of the CustomValue field of the related Campaign resource
  • [ Type TCampaign ]
ContactsListID
OR
ContactsListALT
ContactsListID
ID reference to ContactsList
ContactsListALT
Value of the Address field of the related ContactsList resource
  • [ Type TContactsList ]
CreatedAt Timestamp when object was created in database
  • [ Type TRFC3339DateTime ]
Current Data ID of the current content
  • [ Type Int64 ]
DeliveredAt When the CampaignDraft was delivered.
  • [ Type TRFC3339DateTime ]
EditMode Edit mode for CampaignDraft: tool2 (3), html2 (4) or mjml (5)
  • [ Type AnsiString ]

Allowed values:
  • tool2
  • html2
  • mjml
ID Unique numerical ID for this object
  • Read Only
  • [ Type Int64 ]
IsStarred Is this a starred CampaignDraft?
  • [ Type Boolean ]
IsTextPartIncluded Does the CampaignDraft include a text version ?
  • [ Type Boolean ]
Locale Locale in which the information in this record is saved.
  • Mandatory
  • [ Type AnsiString ]
ModifiedAt Timestamp when CampaignDraft's content was last modified.
  • [ Type TRFC3339DateTime ]
Preset String, representing a JSON array of styles for this CampaignDraft. The API does not interpret the styles.
  • [ Type AnsiString ]
ReplyEmail Reply-To address for the mail.
  • [ Type TEmail ]
SegmentationID
OR
SegmentationALT
SegmentationID
ID reference to ContactFilter
SegmentationALT
Value of the Name field of the related ContactFilter resource
  • [ Type TContactFilter ]
Sender Sender
  • Mandatory
  • [ Type AnsiString ]
SenderEmail Sender email address in headers
  • Mandatory
  • [ Type TEmail ]
SenderName Name of the sender in Sender headers
  • [ Type AnsiString ]
Status Status of the CampaignDraft
  • Read Only
  • [ Type SmallInt ]

Allowed values:
  • AXCanceled (-3)
  • Deleted (-2)
  • Archived (-1)
  • Draft (0)
  • Programmed (1)
  • Sent (2)
  • AXTested (3)
  • AXSelected (4)
Subject CampaignDraft subject
  • Mandatory
  • [ Type AnsiString ]
TemplateID ID reference to Template Refer to the template CampaignDraft was generated from, or as which it was last saved. Changing the template ID will not update the content of the CampaignDraft
  • [ Type TTemplate ]
Title CampaignDraft title
  • [ Type AnsiString ]
Url URL where an online version of the CampaignDraft can be found.
  • [ Type AnsiString ]
Used Did the CampaignDraft was sent or tested?
  • [ Type Boolean ]
Filters
Name Description
AXTesting Only retrieve campaigndraft resources for which AXTesting equals the specified value.
  • [ Type Int64 ]
Campaign Only retrieve campaigndraft resources for which Campaign equals the specified value.
  • [ Type Int64 ]
ContactsList Only retrieve campaigndraft resources for which ContactsList equals the specified value.
  • [ Type Int64 ]
DeliveredAt Only retrieve campaigndraft resources for which DeliveredAt equals the specified value.
  • [ Type TRFC3339DateTime ]
EditMode Only retrieve campaigndraft resources for which EditMode equals the specified value.
  • [ Type AnsiString ]
IsArchived Only retrieve campaigndraft resources for which IsArchived equals the specified value.
  • [ Type TBooleanFilter ]
IsCampaign Only retrieve campaigndraft resources for which IsCampaign equals the specified value.
  • [ Type TBooleanFilter ]
IsDeleted Only retrieve campaigndraft resources for which IsDeleted equals the specified value.
  • [ Type TBooleanFilter ]
IsHandled Only retrieve campaigndraft resources for which IsHandled equals the specified value.
  • [ Type TBooleanFilter ]
IsStarred Only retrieve campaigndraft resources for which IsStarred equals the specified value.
  • [ Type TBooleanFilter ]
Modified Only retrieve campaigndraft resources for which Modified equals the specified value.
  • [ Type Boolean ]
NewsLetterTemplate Only retrieve campaigndraft resources for which NewsLetterTemplate equals the specified value.
  • [ Type Int64 ]
Segmentation Only retrieve campaigndraft resources for which Segmentation equals the specified value.
  • [ Type Int64 ]
Status Only retrieve campaigndraft resources for which Status equals the specified value.
  • [ Type AnsiString ]
Subject Only retrieve campaigndraft resources for which Subject equals the specified value.
  • [ Type AnsiString ]
Template Only retrieve campaigndraft resources for which Template equals the specified value.
  • [ Type Int64 ]

Access a given campaigndraft resource, use a GET request, providing the campaigndraft's ID value.

# access the campaigndraft resource identified by $ID

curl -s -X GET \
--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
https://api.mailjet.com/v3/REST/campaigndraft/$ID

    
    
Properties
Name Description
AXFractionName Fraction of AXTesting in percentage. Zero means remainder
  • [ Type AnsiString ]
AXTesting A reference to AXTesting object
  • [ Type TAXTesting ]
CampaignID
OR
CampaignALT
CampaignID
ID reference to Campaign
CampaignALT
Value of the CustomValue field of the related Campaign resource
  • [ Type TCampaign ]
ContactsListID
OR
ContactsListALT
ContactsListID
ID reference to ContactsList
ContactsListALT
Value of the Address field of the related ContactsList resource
  • [ Type TContactsList ]
CreatedAt Timestamp when object was created in database
  • [ Type TRFC3339DateTime ]
Current Data ID of the current content
  • [ Type Int64 ]
DeliveredAt When the CampaignDraft was delivered.
  • [ Type TRFC3339DateTime ]
EditMode Edit mode for CampaignDraft: tool2 (3), html2 (4) or mjml (5)
  • [ Type AnsiString ]

Allowed values:
  • tool2
  • html2
  • mjml
ID Unique numerical ID for this object
  • Read Only
  • [ Type Int64 ]
IsStarred Is this a starred CampaignDraft?
  • [ Type Boolean ]
IsTextPartIncluded Does the CampaignDraft include a text version ?
  • [ Type Boolean ]
Locale Locale in which the information in this record is saved.
  • Mandatory
  • [ Type AnsiString ]
ModifiedAt Timestamp when CampaignDraft's content was last modified.
  • [ Type TRFC3339DateTime ]
Preset String, representing a JSON array of styles for this CampaignDraft. The API does not interpret the styles.
  • [ Type AnsiString ]
ReplyEmail Reply-To address for the mail.
  • [ Type TEmail ]
SegmentationID
OR
SegmentationALT
SegmentationID
ID reference to ContactFilter
SegmentationALT
Value of the Name field of the related ContactFilter resource
  • [ Type TContactFilter ]
Sender Sender
  • Mandatory
  • [ Type AnsiString ]
SenderEmail Sender email address in headers
  • Mandatory
  • [ Type TEmail ]
SenderName Name of the sender in Sender headers
  • [ Type AnsiString ]
Status Status of the CampaignDraft
  • Read Only
  • [ Type SmallInt ]

Allowed values:
  • AXCanceled (-3)
  • Deleted (-2)
  • Archived (-1)
  • Draft (0)
  • Programmed (1)
  • Sent (2)
  • AXTested (3)
  • AXSelected (4)
Subject CampaignDraft subject
  • Mandatory
  • [ Type AnsiString ]
TemplateID ID reference to Template Refer to the template CampaignDraft was generated from, or as which it was last saved. Changing the template ID will not update the content of the CampaignDraft
  • [ Type TTemplate ]
Title CampaignDraft title
  • [ Type AnsiString ]
Url URL where an online version of the CampaignDraft can be found.
  • [ Type AnsiString ]
Used Did the CampaignDraft was sent or tested?
  • [ Type Boolean ]

Add a new campaigndraft resource with a POST request.

# add a new campaigndraft resource, beware of the Read Only fields!

curl -s -X POST \
--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
https://api.mailjet.com/v3/REST/campaigndraft \
-H 'Content-Type: application/json' \
-d '{"AXFractionName": ...}'
Properties
Name Description
AXFractionName Fraction of AXTesting in percentage. Zero means remainder
  • [ Type AnsiString ]
AXTesting A reference to AXTesting object
  • [ Type TAXTesting ]
CampaignID
OR
CampaignALT
CampaignID
ID reference to Campaign
CampaignALT
Value of the CustomValue field of the related Campaign resource
  • [ Type TCampaign ]
ContactsListID
OR
ContactsListALT
ContactsListID
ID reference to ContactsList
ContactsListALT
Value of the Address field of the related ContactsList resource
  • [ Type TContactsList ]
CreatedAt Timestamp when object was created in database
  • [ Type TRFC3339DateTime ]
Current Data ID of the current content
  • [ Type Int64 ]
DeliveredAt When the CampaignDraft was delivered.
  • [ Type TRFC3339DateTime ]
EditMode Edit mode for CampaignDraft: tool2 (3), html2 (4) or mjml (5)
  • [ Type AnsiString ]

Allowed values:
  • tool2
  • html2
  • mjml
ID Unique numerical ID for this object
  • Read Only
  • [ Type Int64 ]
IsStarred Is this a starred CampaignDraft?
  • [ Type Boolean ]
IsTextPartIncluded Does the CampaignDraft include a text version ?
  • [ Type Boolean ]
Locale Locale in which the information in this record is saved.
  • Mandatory
  • [ Type AnsiString ]
ModifiedAt Timestamp when CampaignDraft's content was last modified.
  • [ Type TRFC3339DateTime ]
Preset String, representing a JSON array of styles for this CampaignDraft. The API does not interpret the styles.
  • [ Type AnsiString ]
ReplyEmail Reply-To address for the mail.
  • [ Type TEmail ]
SegmentationID
OR
SegmentationALT
SegmentationID
ID reference to ContactFilter
SegmentationALT
Value of the Name field of the related ContactFilter resource
  • [ Type TContactFilter ]
Sender Sender
  • Mandatory
  • [ Type AnsiString ]
SenderEmail Sender email address in headers
  • Mandatory
  • [ Type TEmail ]
SenderName Name of the sender in Sender headers
  • [ Type AnsiString ]
Status Status of the CampaignDraft
  • Read Only
  • [ Type SmallInt ]

Allowed values:
  • AXCanceled (-3)
  • Deleted (-2)
  • Archived (-1)
  • Draft (0)
  • Programmed (1)
  • Sent (2)
  • AXTested (3)
  • AXSelected (4)
Subject CampaignDraft subject
  • Mandatory
  • [ Type AnsiString ]
TemplateID ID reference to Template Refer to the template CampaignDraft was generated from, or as which it was last saved. Changing the template ID will not update the content of the CampaignDraft
  • [ Type TTemplate ]
Title CampaignDraft title
  • [ Type AnsiString ]
Url URL where an online version of the CampaignDraft can be found.
  • [ Type AnsiString ]
Used Did the CampaignDraft was sent or tested?
  • [ Type Boolean ]

Update one specific campaigndraft resource with a PUT request, providing the campaigndraft's ID value. Be sure to include all the mandatory properties.

# update content of resource campaigndraft identified by ID $ID

curl -s -X PUT \
--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
https://api.mailjet.com/v3/REST/campaigndraft/$ID \
-H 'Content-Type: application/json' \
-d '{"AXFractionName": ...}'

    
Properties
Name Description
AXFractionName Fraction of AXTesting in percentage. Zero means remainder
  • [ Type AnsiString ]
AXTesting A reference to AXTesting object
  • [ Type TAXTesting ]
CampaignID
OR
CampaignALT
CampaignID
ID reference to Campaign
CampaignALT
Value of the CustomValue field of the related Campaign resource
  • [ Type TCampaign ]
ContactsListID
OR
ContactsListALT
ContactsListID
ID reference to ContactsList
ContactsListALT
Value of the Address field of the related ContactsList resource
  • [ Type TContactsList ]
CreatedAt Timestamp when object was created in database
  • [ Type TRFC3339DateTime ]
Current Data ID of the current content
  • [ Type Int64 ]
DeliveredAt When the CampaignDraft was delivered.
  • [ Type TRFC3339DateTime ]
EditMode Edit mode for CampaignDraft: tool2 (3), html2 (4) or mjml (5)
  • [ Type AnsiString ]

Allowed values:
  • tool2
  • html2
  • mjml
ID Unique numerical ID for this object
  • Read Only
  • [ Type Int64 ]
IsStarred Is this a starred CampaignDraft?
  • [ Type Boolean ]
IsTextPartIncluded Does the CampaignDraft include a text version ?
  • [ Type Boolean ]
Locale Locale in which the information in this record is saved.
  • Mandatory
  • [ Type AnsiString ]
ModifiedAt Timestamp when CampaignDraft's content was last modified.
  • [ Type TRFC3339DateTime ]
Preset String, representing a JSON array of styles for this CampaignDraft. The API does not interpret the styles.
  • [ Type AnsiString ]
ReplyEmail Reply-To address for the mail.
  • [ Type TEmail ]
SegmentationID
OR
SegmentationALT
SegmentationID
ID reference to ContactFilter
SegmentationALT
Value of the Name field of the related ContactFilter resource
  • [ Type TContactFilter ]
Sender Sender
  • Mandatory
  • [ Type AnsiString ]
SenderEmail Sender email address in headers
  • Mandatory
  • [ Type TEmail ]
SenderName Name of the sender in Sender headers
  • [ Type AnsiString ]
Status Status of the CampaignDraft
  • Read Only
  • [ Type SmallInt ]

Allowed values:
  • AXCanceled (-3)
  • Deleted (-2)
  • Archived (-1)
  • Draft (0)
  • Programmed (1)
  • Sent (2)
  • AXTested (3)
  • AXSelected (4)
Subject CampaignDraft subject
  • Mandatory
  • [ Type AnsiString ]
TemplateID ID reference to Template Refer to the template CampaignDraft was generated from, or as which it was last saved. Changing the template ID will not update the content of the CampaignDraft
  • [ Type TTemplate ]
Title CampaignDraft title
  • [ Type AnsiString ]
Url URL where an online version of the CampaignDraft can be found.
  • [ Type AnsiString ]
Used Did the CampaignDraft was sent or tested?
  • [ Type Boolean ]