Campaigns
Use these APIs to create, update and read 10DLC Campaign Records, as well as add supporting files to existing Campaign Records
Schema
| Name | Type | Description |
|---|---|---|
| legal_company_name | String required | The campaign’s SS4/CRA/Incorporation documents. |
| usecase | String required | For campaign volume under 15k monthly, select ‘Low-volume mixed’ and provide 1-5 sub-usecases. For campaign volume over 15k monthly, select ‘Mixed’ and provide 2 -5 sub usecases. |
| Valid inputs: | Account Notification,Customer Care,Delivery Notification,Fraud Alert Messaging,Higher Education,Low Volume Mixed,Low-Volume Mixed,Marketing,Mixed,Polling and Voting,Public Service Announcement,Security Alert,Machine to Machine,2FA | |
| campaign_description | String required | Describe the SMS traffic including intended recipients and subject matter. To request expedite, enter ‘EXPEDITE: ’ followed by description. Additional fees apply. See 10 DLC Campaign Registration Overview below for further details. |
| call_to_action_message_flow | String required | Describe how a consumer opts-in to the campaign, therefore giving consent to the sender to receive their messages. |
| sub_usecase_1 | String | When “Low Volume Mixed” is selected as the usecase, provide 1-5 sub-usecases. When “Mixed” is selected as the usecase, select 2-5 sub-usecases. |
| Valid Inputs: | Account Notification,Customer Care,Delivery Notification,Fraud Alert Messaging,Higher Education,Marketing,Polling and Voting,Public Service Announcement,Security Alert,2FA | |
| sub_usecase_2 | String | |
| sub_usecase_3 | String | |
| sub_usecase_4 | String | |
| sub_usecase_5 | String | |
| embedded_link | boolean | Does your campaign include an embedded link of any kind? Note public URL shorteners (bitly, tinyurl) are not accepted |
| embedded_link_sample | String(format:url) | An example url of an embedded link |
| embedded_phone_number | boolean | Does your campaign use an embedded phone number? |
| direct_lending_or_loan_arrangement | boolean | Does your campaign include content related to direct lending or loan arrangements? |
| age_gated_content | boolean | Does your campaign include age-gated content? |
| sample_message_1 | String required | An example of the type of messaging you will be sending |
| sample_message_2 | String | |
| sample_message_3 | String | |
| sample_message_4 | String | |
| sample_message_5 | String | |
| terms_and_conditions_link | String | A link to the campaigns terms and conditions |
| privacy_policy_link | String(format:url) | A link to the campaigns privacy policy |
| requested_area_code | String | A requested area code for a new number to add to this campaign |
| webhook | String(format:url) | A URL that will have POSTs sent to with any status changes to the brand. |
Webhook Format:
{ "id": "123xxx456", "legal_company_name": "Company Name", "status": "Pending", "rejection_reason": "reason" // if the status is Rejected}Create a new Campaign Record
Request:
POST api.swift-api.com/api/v0/campaignsContent-Type: application/jsonAuthorization: Bearer ABC123{ "data": { "legal_company_name": "Brett Test", "usecase": "Low Volume Mixed", "campaign_description": "description", "call_to_action_message_flow": "test", "privacy_policy_link": "www.url.com/privacy_policy", "terms_and_conditions_link": "www.url.com/tc", "embedded_phone_number": true, "embedded_link": true, "embedded_link_sample": "www.url.com", "age_gated_content": false, "direct_lending_or_loan_arrangement": false, "sample_message_1": "sample", "sample_message_2": "", "sample_message_3": "", "sample_message_4": "", "sample_message_5": "", "sub_usecase_1": "Account Notification", "sub_usecase_2": "", "sub_usecase_3": "", "sub_usecase_4": "", "sub_usecase_5": "", "requested_area_code": "705", "webhook": "www.url3.com" }}Response:
HTTP/1.1 200 OKContent-Type: application/json
{ "data": { "id": "234xxx345" }, "type": "csp_brand"}Get a Campaign Record
Request:
GET api.swift-api.com/api/v0/campaigns/[id]/Authorization: Bearer ABC123Response:
HTTP/1.1 200 OKContent-Type: application/json
{ "data": { "status": "Pending", "rejection_reason": "reason" //if status is Rejected "legal_company_name": "Brett Test", "usecase": "Low Volume Mixed", "campaign_description": "description", "call_to_action_message_flow": "test", "privacy_policy_link": "www.url.com/privacy_policy", "terms_and_conditions_link": "www.url.com/tc", "embedded_phone_number": true, "embedded_link": true, "embedded_link_sample": "www.url.com", "age_gated_content": false, "direct_lending_or_loan_arrangement": false, "sample_message_1": "sample", "sample_message_2": "", "sample_message_3": "", "sample_message_4": "", "sample_message_5": "", "sub_usecase_1": "Account Notification", "sub_usecase_2": "", "sub_usecase_3": "", "sub_usecase_4": "", "sub_usecase_5": "", "requested_area_code": "705", "webhook": "www.url3.com" }}Update a Campaign Record
Request:
PUT api.swift-api.com/api/v0/campaigns/[id]/Content-Type: application/jsonAuthorization: Bearer apik_ABC123{ "data": { "sample_message_2": "new message", "embedded_link": false }}Response:
HTTP/1.1 204 No ContentAdd a file to a Campaign Record
Request:
PUT api.swift-api.com/api/v0/campaigns/[id]/attachments/Content-Type: multipart/form-dataAuthorization: Bearer apik_ABC123
Body:key: "type", value "terms_and_conditions " //Valid inputs are `terms_and_conditions`,`call_to_action ` or `privacy_policy `,key: "file", value: your fileResponse:
HTTP/1.1 204 No Content