|
10 | 10 | # POST /campaigns # |
11 | 11 |
|
12 | 12 | data = { |
13 | | - "categories": [ |
14 | | - "spring line" |
15 | | - ], |
16 | | - "custom_unsubscribe_url": "", |
17 | | - "html_content": "<html><head><title></title></head><body><p>Check out our spring line!</p></body></html>", |
18 | | - "ip_pool": "marketing", |
19 | | - "list_ids": [ |
20 | | - 110, |
21 | | - 124 |
22 | | - ], |
23 | | - "plain_content": "Check out our spring line!", |
24 | | - "segment_ids": [ |
25 | | - 110 |
26 | | - ], |
27 | | - "sender_id": 124451, |
28 | | - "subject": "New Products for Spring!", |
29 | | - "suppression_group_id": 42, |
30 | | - "title": "March Newsletter" |
| 13 | + "categories": [ |
| 14 | + "spring line" |
| 15 | + ], |
| 16 | + "custom_unsubscribe_url": "", |
| 17 | + "html_content": "<html><head><title></title></head><body><p>Check out our spring line!</p></body></html>", |
| 18 | + "ip_pool": "marketing", |
| 19 | + "list_ids": [ |
| 20 | + 110, |
| 21 | + 124 |
| 22 | + ], |
| 23 | + "plain_content": "Check out our spring line!", |
| 24 | + "segment_ids": [ |
| 25 | + 110 |
| 26 | + ], |
| 27 | + "sender_id": 124451, |
| 28 | + "subject": "New Products for Spring!", |
| 29 | + "suppression_group_id": 42, |
| 30 | + "title": "March Newsletter" |
31 | 31 | } |
32 | 32 | response = sg.client.campaigns.post(request_body=data) |
33 | 33 | print(response.status_code) |
|
49 | 49 | # PATCH /campaigns/{campaign_id} # |
50 | 50 |
|
51 | 51 | data = { |
52 | | - "categories": [ |
53 | | - "summer line" |
54 | | - ], |
55 | | - "html_content": "<html><head><title></title></head><body><p>Check out our summer line!</p></body></html>", |
56 | | - "plain_content": "Check out our summer line!", |
57 | | - "subject": "New Products for Summer!", |
58 | | - "title": "May Newsletter" |
| 52 | + "categories": [ |
| 53 | + "summer line" |
| 54 | + ], |
| 55 | + "html_content": "<html><head><title></title></head><body><p>Check out our summer line!</p></body></html>", |
| 56 | + "plain_content": "Check out our summer line!", |
| 57 | + "subject": "New Products for Summer!", |
| 58 | + "title": "May Newsletter" |
59 | 59 | } |
60 | 60 | campaign_id = "test_url_param" |
61 | 61 | response = sg.client.campaigns._(campaign_id).patch(request_body=data) |
|
88 | 88 | # PATCH /campaigns/{campaign_id}/schedules # |
89 | 89 |
|
90 | 90 | data = { |
91 | | - "send_at": 1489451436 |
| 91 | + "send_at": 1489451436 |
92 | 92 | } |
93 | 93 | campaign_id = "test_url_param" |
94 | | -response = sg.client.campaigns._(campaign_id).schedules.patch(request_body=data) |
| 94 | +response = sg.client.campaigns._( |
| 95 | + campaign_id).schedules.patch(request_body=data) |
95 | 96 | print(response.status_code) |
96 | 97 | print(response.body) |
97 | 98 | print(response.headers) |
|
101 | 102 | # POST /campaigns/{campaign_id}/schedules # |
102 | 103 |
|
103 | 104 | data = { |
104 | | - "send_at": 1489771528 |
| 105 | + "send_at": 1489771528 |
105 | 106 | } |
106 | 107 | campaign_id = "test_url_param" |
107 | 108 | response = sg.client.campaigns._(campaign_id).schedules.post(request_body=data) |
|
144 | 145 | # POST /campaigns/{campaign_id}/schedules/test # |
145 | 146 |
|
146 | 147 | data = { |
147 | | - "to": "your.email@example.com" |
| 148 | + "to": "your.email@example.com" |
148 | 149 | } |
149 | 150 | campaign_id = "test_url_param" |
150 | | -response = sg.client.campaigns._(campaign_id).schedules.test.post(request_body=data) |
| 151 | +response = sg.client.campaigns._( |
| 152 | + campaign_id).schedules.test.post(request_body=data) |
151 | 153 | print(response.status_code) |
152 | 154 | print(response.body) |
153 | 155 | print(response.headers) |
154 | | - |
|
0 commit comments