|
1
|
get: |
|
2
|
operationId: GetCampaignsId |
|
3
|
summary: Get a Campaign |
|
4
|
description: >- |
|
5
|
Retrieve a campaign by its ID. You can expand the campaign's relations or |
|
6
|
select the fields that should be returned using the query parameters. |
|
7
|
x-authenticated: true |
|
8
|
parameters: |
|
9
|
- name: id |
|
10
|
in: path |
|
11
|
description: The campaign's ID. |
|
12
|
required: true |
|
13
|
schema: |
|
14
|
type: string |
|
15
|
- name: fields |
|
16
|
in: query |
|
17
|
description: >- |
|
18
|
Comma-separated fields that should be included in the returned data. if |
|
19
|
a field is prefixed with `+` it will be added to the default fields, |
|
20
|
using `-` will remove it from the default fields. without prefix it will |
|
21
|
replace the entire default fields. |
|
22
|
required: false |
|
23
|
schema: |
|
24
|
type: string |
|
25
|
title: fields |
|
26
|
description: >- |
|
27
|
Comma-separated fields that should be included in the returned data. |
|
28
|
if a field is prefixed with `+` it will be added to the default |
|
29
|
fields, using `-` will remove it from the default fields. without |
|
30
|
prefix it will replace the entire default fields. |
|
31
|
externalDocs: |
|
32
|
url: '#select-fields-and-relations' |
|
33
|
security: |
|
34
|
- api_token: [] |
|
35
|
- cookie_auth: [] |
|
36
|
- jwt_token: [] |
|
37
|
x-codeSamples: |
|
38
|
- lang: JavaScript |
|
39
|
label: JS SDK |
|
40
|
source: |
|
41
|
$ref: ../code_samples/JavaScript/admin_campaigns_{id}/get.js |
|
42
|
- lang: Shell |
|
43
|
label: cURL |
|
44
|
source: |
|
45
|
$ref: ../code_samples/Shell/admin_campaigns_{id}/get.sh |
|
46
|
tags: |
|
47
|
- Campaigns |
|
48
|
responses: |
|
49
|
'200': |
|
50
|
description: OK |
|
51
|
content: |
|
52
|
application/json: |
|
53
|
schema: |
|
54
|
$ref: ../components/schemas/AdminCampaignResponse.yaml |
|
55
|
'400': |
|
56
|
$ref: ../components/responses/400_error.yaml |
|
57
|
'401': |
|
58
|
$ref: ../components/responses/unauthorized.yaml |
|
59
|
'404': |
|
60
|
$ref: ../components/responses/not_found_error.yaml |
|
61
|
'409': |
|
62
|
$ref: ../components/responses/invalid_state_error.yaml |
|
63
|
'422': |
|
64
|
$ref: ../components/responses/invalid_request_error.yaml |
|
65
|
'500': |
|
66
|
$ref: ../components/responses/500_error.yaml |
|
67
|
post: |
|
68
|
operationId: PostCampaignsId |
|
69
|
summary: Update a Campaign |
|
70
|
description: Update a campaign's details. |
|
71
|
x-authenticated: true |
|
72
|
parameters: |
|
73
|
- name: id |
|
74
|
in: path |
|
75
|
description: The campaign's ID. |
|
76
|
required: true |
|
77
|
schema: |
|
78
|
type: string |
|
79
|
- name: fields |
|
80
|
in: query |
|
81
|
description: >- |
|
82
|
Comma-separated fields that should be included in the returned data. if |
|
83
|
a field is prefixed with `+` it will be added to the default fields, |
|
84
|
using `-` will remove it from the default fields. without prefix it will |
|
85
|
replace the entire default fields. |
|
86
|
required: false |
|
87
|
schema: |
|
88
|
type: string |
|
89
|
title: fields |
|
90
|
description: >- |
|
91
|
Comma-separated fields that should be included in the returned data. |
|
92
|
if a field is prefixed with `+` it will be added to the default |
|
93
|
fields, using `-` will remove it from the default fields. without |
|
94
|
prefix it will replace the entire default fields. |
|
95
|
externalDocs: |
|
96
|
url: '#select-fields-and-relations' |
|
97
|
security: |
|
98
|
- api_token: [] |
|
99
|
- cookie_auth: [] |
|
100
|
- jwt_token: [] |
|
101
|
requestBody: |
|
102
|
content: |
|
103
|
application/json: |
|
104
|
schema: |
|
105
|
allOf: |
|
106
|
- type: object |
|
107
|
description: The campaign's details. |
|
108
|
required: |
|
109
|
- description |
|
110
|
- starts_at |
|
111
|
- ends_at |
|
112
|
properties: |
|
113
|
name: |
|
114
|
type: string |
|
115
|
title: name |
|
116
|
description: The campaign's name. |
|
117
|
campaign_identifier: |
|
118
|
type: string |
|
119
|
title: campaign_identifier |
|
120
|
description: The campaign's identifier. |
|
121
|
description: |
|
122
|
type: string |
|
123
|
title: description |
|
124
|
description: The campaign's description. |
|
125
|
budget: |
|
126
|
type: object |
|
127
|
description: The campaign's budget. |
|
128
|
required: |
|
129
|
- limit |
|
130
|
properties: |
|
131
|
limit: |
|
132
|
type: number |
|
133
|
title: limit |
|
134
|
description: The campaign budget's limit. |
|
135
|
starts_at: |
|
136
|
type: string |
|
137
|
title: starts_at |
|
138
|
description: The campaign's start date. |
|
139
|
format: date-time |
|
140
|
ends_at: |
|
141
|
type: string |
|
142
|
title: ends_at |
|
143
|
description: The campaign's end date. |
|
144
|
format: date-time |
|
145
|
promotions: |
|
146
|
type: array |
|
147
|
description: The campaign's promotions. |
|
148
|
items: |
|
149
|
type: object |
|
150
|
description: The promotions to add to the campaign. |
|
151
|
required: |
|
152
|
- id |
|
153
|
properties: |
|
154
|
id: |
|
155
|
type: string |
|
156
|
title: id |
|
157
|
description: A promotion's ID. |
|
158
|
- type: object |
|
159
|
description: The campaign's details. |
|
160
|
properties: |
|
161
|
additional_data: |
|
162
|
type: object |
|
163
|
description: >- |
|
164
|
Pass additional custom data to the API route. This data is |
|
165
|
passed to the underlying workflow under the |
|
166
|
`additional_data` parameter. |
|
167
|
description: The campaign's details. |
|
168
|
x-codeSamples: |
|
169
|
- lang: JavaScript |
|
170
|
label: JS SDK |
|
171
|
source: |
|
172
|
$ref: ../code_samples/JavaScript/admin_campaigns_{id}/post.js |
|
173
|
- lang: Shell |
|
174
|
label: cURL |
|
175
|
source: |
|
176
|
$ref: ../code_samples/Shell/admin_campaigns_{id}/post.sh |
|
177
|
tags: |
|
178
|
- Campaigns |
|
179
|
responses: |
|
180
|
'200': |
|
181
|
description: OK |
|
182
|
content: |
|
183
|
application/json: |
|
184
|
schema: |
|
185
|
$ref: ../components/schemas/AdminCampaignResponse.yaml |
|
186
|
'400': |
|
187
|
$ref: ../components/responses/400_error.yaml |
|
188
|
'401': |
|
189
|
$ref: ../components/responses/unauthorized.yaml |
|
190
|
'404': |
|
191
|
$ref: ../components/responses/not_found_error.yaml |
|
192
|
'409': |
|
193
|
$ref: ../components/responses/invalid_state_error.yaml |
|
194
|
'422': |
|
195
|
$ref: ../components/responses/invalid_request_error.yaml |
|
196
|
'500': |
|
197
|
$ref: ../components/responses/500_error.yaml |
|
198
|
x-workflow: updateCampaignsWorkflow |
|
199
|
x-events: [] |
|
200
|
delete: |
|
201
|
operationId: DeleteCampaignsId |
|
202
|
summary: Delete a Campaign |
|
203
|
description: > |
|
204
|
Delete a campaign by its ID. This doesn't delete promotions that belong to |
|
205
|
this campaign. |
|
206
|
x-authenticated: true |
|
207
|
parameters: |
|
208
|
- name: id |
|
209
|
in: path |
|
210
|
description: The campaign's ID. |
|
211
|
required: true |
|
212
|
schema: |
|
213
|
type: string |
|
214
|
security: |
|
215
|
- api_token: [] |
|
216
|
- cookie_auth: [] |
|
217
|
- jwt_token: [] |
|
218
|
x-codeSamples: |
|
219
|
- lang: JavaScript |
|
220
|
label: JS SDK |
|
221
|
source: |
|
222
|
$ref: ../code_samples/JavaScript/admin_campaigns_{id}/delete.js |
|
223
|
- lang: Shell |
|
224
|
label: cURL |
|
225
|
source: |
|
226
|
$ref: ../code_samples/Shell/admin_campaigns_{id}/delete.sh |
|
227
|
tags: |
|
228
|
- Campaigns |
|
229
|
responses: |
|
230
|
'200': |
|
231
|
description: OK |
|
232
|
content: |
|
233
|
application/json: |
|
234
|
schema: |
|
235
|
type: object |
|
236
|
description: The deletion's details. |
|
237
|
required: |
|
238
|
- id |
|
239
|
- object |
|
240
|
- deleted |
|
241
|
properties: |
|
242
|
id: |
|
243
|
type: string |
|
244
|
title: id |
|
245
|
description: The campaign's ID. |
|
246
|
object: |
|
247
|
type: string |
|
248
|
title: object |
|
249
|
description: The name of the object that was deleted. |
|
250
|
default: campaign |
|
251
|
deleted: |
|
252
|
type: boolean |
|
253
|
title: deleted |
|
254
|
description: Whether the campaign was deleted. |
|
255
|
'400': |
|
256
|
$ref: ../components/responses/400_error.yaml |
|
257
|
'401': |
|
258
|
$ref: ../components/responses/unauthorized.yaml |
|
259
|
'404': |
|
260
|
$ref: ../components/responses/not_found_error.yaml |
|
261
|
'409': |
|
262
|
$ref: ../components/responses/invalid_state_error.yaml |
|
263
|
'422': |
|
264
|
$ref: ../components/responses/invalid_request_error.yaml |
|
265
|
'500': |
|
266
|
$ref: ../components/responses/500_error.yaml |
|
267
|
x-workflow: deleteCampaignsWorkflow |
|
268
|
x-events: [] |