UNPKG

omnisend-node-sdk

Version:

🔹 Typesafe Omnisend API SDK for Node.js

70 lines (69 loc) • 3.45 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Campaigns = void 0; class Campaigns { constructor(http) { /** * No description * * @tags Campaigns * @name GetCampaignsCampaignId * @summary Get campaign's info * @request GET:/campaigns/{campaignID} * @secure */ this.getCampaignsCampaignId = (campaignId, params = {}) => this.http.request(Object.assign({ path: `/campaigns/${campaignId}`, method: "GET", secure: true, format: "json" }, params)); /** * @description **Curl example:** ```php curl -X DELETE "https://api.omnisend.com/v3/campaigns/59099010597ed74f6635fb14" ``` **Note**: only `sent` and `draft` campaigns cant be deleted. * * @tags Campaigns * @name DeleteCampaignsCampaignId * @summary Delete campaign * @request DELETE:/campaigns/{campaignID} * @secure */ this.deleteCampaignsCampaignId = (campaignId, params = {}) => this.http.request(Object.assign({ path: `/campaigns/${campaignId}`, method: "DELETE", secure: true }, params)); /** * No description * * @tags Campaigns * @name GetCampaigns * @summary List campaigns * @request GET:/campaigns * @secure */ this.getCampaigns = (query, params = {}) => this.http.request(Object.assign({ path: `/campaigns`, method: "GET", query, secure: true, format: "json" }, params)); /** * No description * * @tags Campaigns * @name GetCampaignsCampaignIdContactsContactId * @summary Get campaign's contact * @request GET:/campaigns/{campaignID}/contacts/{contactID} * @secure */ this.getCampaignsCampaignIdContactsContactId = (campaignId, contactId, params = {}) => this.http.request(Object.assign({ path: `/campaigns/${campaignId}/contacts/${contactId}`, method: "GET", secure: true, format: "json" }, params)); /** * @description There is ability to get campaign contacts which `opened` email, `clicked` on links in email, `unsubsribed`, `complained` or `bounced`. Just pass query parameter with value **true**. **Example**: https://api.omnisend.com/v3/campaigns/59099010597ed74f6635fb14/contacts?**clicked=true** * * @tags Campaigns * @name GetCampaignsCampaignIdContacts * @summary List campaign contacts * @request GET:/campaigns/{campaignID}/contacts * @secure */ this.getCampaignsCampaignIdContacts = (campaignId, query, params = {}) => this.http.request(Object.assign({ path: `/campaigns/${campaignId}/contacts`, method: "GET", query, secure: true, format: "json" }, params)); /** * @description Start sending campaign emails - if campaign is in draft or scheduled mode. * * @tags Campaigns * @name PostCampaignsCampaignIdActionsStart * @summary Start sending campaign emails * @request POST:/campaigns/{campaignID}/actions/start * @secure */ this.postCampaignsCampaignIdActionsStart = (campaignId, params = {}) => this.http.request(Object.assign({ path: `/campaigns/${campaignId}/actions/start`, method: "POST", secure: true, format: "json" }, params)); this.http = http; } } exports.Campaigns = Campaigns;