Upload a new campaign, specified by its name, subject, HTML body, text body, and format, and if user chooses, create a journey using this uploaded campaign.


JSON Request Example:             

{
  "username": "JohnDoe",
  "usertoken": "abc123abc123abc123abc123",
  "requesttype": "Newsletters",
  "requestmethod": "UploadNewsletter",
  "details": {
    "name": "{*name*}", /* required */
    "subject": "{*subject*}", /* required */
    "format": "{*format*}", /* required */
    "htmlbody": "<{*html_body*}>", /* required if format h or b */
    "textbody": "<!{*text_body*}>", /* required if format t or b */
    "approved": "{*approved_boolean*}",
    "active": "{*active_boolean*}",
    "archive": "{*archive_boolean*}",
    "emailtype": "{*newsletter or journey*}",
    "listid": "{*list-id (to create a 'magic journey'*}",
  }
}


PLEASE NOTE: JSON requires a strict code format. Please ensure that your template code conforms to the JSON requirements. Thank you.  


"json_request" element


Field NameDescription
usernameUsername used to login to Pinpointe
usertokenUnique token assigned to Pinpointe account
requesttypeNewsletters
requestmethodUploadNewsletter


"details" element


Field NameDescription
name
(required)
Name of the Campaign being created
subject
(required)
Email Subject of the Campaign being created
format
(required)
specify which format(s) to send. Use h for HTML, t for text, or b for both
htmlbody
(required if format "h" or "b")
Email body in HTML format.
textbody
(required if format "t" or "b")
Email body in text format.
approved
(optional)
Enter 1, yes or true for affirmative; 0, no, or false for negative. Default is "true"
active
(optional)
Enter 1, yes or true for affirmative; 0, no, or false for negative. default is "true"
archive
(optional)
Enter 1, yes or true for affirmative; 0, no, or false for negative. Default is "false"
emailtype
(optional)
"newsletter" to create a standard newsletter
"journey" to create a journey letter
NOTE: these designations are technically for categorical purposes, however, only "journey" newsletters will have stats / metrics in the Journeys feature.  Although both standard and journey newsletters can be used to create a journey, we strongly recommend making the emailtype =  "journey" when creating journeys with this call so so as to ensure system will provide stats / metrics. 
listid
(required if "emailtype" parameter used)
list ID associated with creation of journey


Successful Response:


"response"  and "response" => "data" elements


Field NameDescription
statusWill return SUCCESS if template code was successfully added
newsletteridID number of newsletter created
listid
(if optional parameter used)
list ID associated with creation of journey
campaignid
(if journey created)
Same value as newsletterid
newBoolean



Null

Unsuccessful Response:


"response" element


Field NameDescription
statusWill return ERROR if unsuccessful
errormessageText explaining why request failed