Create Message From URL
Create Message From URL
Function
createMessageFromURL()
Parameters
- username:
String
- Account login name.
- password:
String
- Account password.
- name:
String
- name of content message.
- categoryId:
int
- category to create Message in.
-1
for default top level category.
- htmlContentURL:
String
- message content URL for html based viewing
- textContentURL:
String
- message content URL for text viewing allowed.
- mobileContentURL:
String
- message content URL for mobile viewing allowed.
- headerId:
int
- content ID of header
- footerId:
int
- content ID of footer
Return
int
:message ID
: the newly created message id
Exception
- PuresendException
Documentation
- Sets and post-processes the specified content type to the contents of the specified URL and creates a Message.
- Fails if the MIME type returned by the URL doesn’t match the requested MIME type.
Examples
public void createMessageFromURLSample() throws java.lang.Exception {
Puresend p = new Puresend();
PuresendPortType port = p.getPuresendHttpsSoap12Endpoint();
String username = "XXX";
String password = "XXX";
String messageName = "SampleName";
String htmlContentURL = "https://sample/html/content";
String textContentURL = "https://sample/text/content";
String mobileContentURL = "https://sample/mobile/content";
Integer headerId = 1234;
Integer footerId = 1235;
int messageId = port.createMessageFromURL(username, password, messageName, -1, htmlContentURL, textContentURL, mobileContentURL, headerId, footerId);
System.out.println(messageId);
}
<?php
include 'puresend.php';
$p = new Puresend();
$createMessageFromURLData = new createMessageFromURL();
$createMessageFromURLData->username = 'XXX';
$createMessageFromURLData->password = 'XXX';
$createMessageFromURLData->name = "SampleName";
$createMessageFromURLData->categoryId= -1;
$createMessageFromURLData->htmlContentURL = "https://sample/html/content";
$createMessageFromURLData->textContentURL = "https://sample/text/content";
$createMessageFromURLData->mobileContentURL = "https://sample/mobile/content";
$createMessageFromURLData->headerId = 1234;
$createMessageFromURLData->footerId = 1235;
$response = $p->createMessageFromURL($createMessageFromURLData);
var_dump($response);
?>