send a delivery with JS
How can i send a delivery with Javascript?
Example code please.
thanks
How can i send a delivery with Javascript?
Example code please.
thanks
Hi @alnavarg,
To send a delivery in Adobe Campaign using JavaScript, you can use the SOAP API provided by Adobe Campaign.
Here is an example code snippet to create a delivery:
// Set up the SOAP client
var soap = require('soap');
var url = 'https://example.com/nl/jsp/soaprouter.jsp?wsdl';
var options = {
forceSoap12Headers: true
};
var client = await soap.createClientAsync(url, options);
// Set up the delivery properties
var delivery = {
name: 'My Delivery',
label: 'My Delivery Label',
startDate: new Date(),
endDate: new Date(),
content: {
type: 'Delivery',
htmlBody: '<html><body>Hello World!</body></html>'
}
};
// Create the delivery
var result = await client.createAsync({ delivery: delivery });
console.log(result);
This code sets up a SOAP client using the soap library, sets the properties of the delivery, and then calls the createAsync method of the SOAP client to create the delivery.
Note that this is just a basic example and you may need to modify the code depending on your specific requirements and the configuration of your Adobe Campaign instance.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.