https://api.affiliates.iugu.com/campaigns
Cria uma nova campanha
Sem ações implementadas definidas
Request
Headers |
|
---|---|
workspace_id
Required Type: string Identificador do workspace Ex: 4fHECmQtLdROI4fDLWMiLd |
Body Required Content Type: application/json |
||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"campaign": {
"name": "Campanha de Verão",
"event": "Pix",
"kind": 2,
"amount": 0.1,
"start_date": "2023-12-09",
"end_date": "2023-12-13",
"level_config": {
"level_1": 50,
"level_2": 50
}
}
}
Response
201 |
||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Created
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
"id": "58HKqRy8w2iHoKT91HCIeI",
"name": "Campanha de Verão",
"workspace_id": "6AaVMPZBMTMweShgqdA7nR",
"event": "Pix",
"kind": 2,
"amount": 0.1,
"start_date": "2023-12-09",
"end_date": "2023-12-13",
"level_config": {
"level_1": 50,
"level_2": 50
},
"affiliates": "[\"5EufttluGZIPaQKN5PF4X4\", \"0cxvXAS3uPZut5z1mVKI20\"]",
"created_at": "2023-12-08T16:41:22.922Z",
"updated_at": "2023-12-08T16:44:02.572Z"
}
422 |
||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Unprocessable Entity
|
1
2
3
4
5
6
7
{
"name": "[\"não pode ficar em branco\"]",
"event": "[\"não pode ficar em branco\"]",
"kind": "[\"não pode ficar em branco\",\"não é válido\"]",
"amount": "[\"não pode ficar em branco\",\"não é válido\"]",
"start_date": "[\"não pode ficar em branco\",\"não é válido\"]"
}
401 |
||||||
---|---|---|---|---|---|---|
Unauthorized
|
1
2
3
4
5
{
"status": "401",
"title": "JWT VALIDATION ERROR",
"detail": "Signature has expired"
}
500 |
||||||
---|---|---|---|---|---|---|
Internal Server Error
|
1
2
3
4
5
{
"status": "500",
"title": "Internal Server Error",
"detail": "Internal Error, try again later"
}