import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
campaign_monitor: {
type: "app",
app: "campaign_monitor",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://api.createsend.com/api/v3.3/primarycontact.json`,
headers: {
Authorization: `Bearer ${this.campaign_monitor.$auth.oauth_access_token}`,
"Content-Type": `application/json; charset=utf-8`,
},
})
},
})
Creates a new subscriber on a specific list. See the documentation
Sends an intelligent transactional email to a specified recipient. See the documentation
Removes a subscriber from a mailing list given their email address. See the documentation
Campaign Monitor uses OAuth authentication. When you connect your Campaign Monitor account, Pipedream will open a popup window where you can sign into Campaign Monitor and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Campaign Monitor API.
Pipedream requests the following authorization scopes when you connect your account:
ViewReports
ManageLists
ImportSubscribers
ViewTransactional
SendTransactional
AdministerAccount
GET
https://api.createsend.com/oauth
?
client_id={{oauth.client_id}}
&
redirect_uri={{oauth.redirect_uri}}
&
state={{oauth.state}}
&
response_type=code
&
scope={{oauth.comma_separated_scopes}}
&
type=web_server
POST
https://api.createsend.com/oauth/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
redirect_uri={{oauth.redirect_uri}}
&
grant_type=authorization_code
&
code={{oauth.code}}
POST
https://api.createsend.com/oauth/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
grant_type=refresh_token
&
refresh_token={{oauth.refresh_token}}