Professional Documents
Culture Documents
Route (POST)
/api/v1/campaign/create/
Headers
- “Content-Type: application/json”
- “Authorization: {token}”
Body
The request body should be a JSON object with the following properties:
filters Array of JSON objects List of filter types and their values of
the campaign
{
"title": "Test Campaign",
"description": "Test Description",
"imageLink": "Link",
"cloudinaryID": "Identifier",
"filters": [
{
"type": "gender",
"value": "male"
},
{
"type": "gender",
"value": "female"
},
{
"type": "city",
"value": "Inde By"
},
{
"type": "passion",
"value": "hairstyles"
}
],
"segments": [
{
"date": "2024-03-15",
"time": "17:00:00",
"tokensCount": 2
},
{
"date": "2024-03-17",
"time": "17:00:00",
"tokensCount": 2
},
{
"date": "2024-03-18",
"time": "17:00:00",
"tokensCount": 2
}
]
}
Responses
Success Response
json
{
"token":
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6NTcsInRpbWVzdGFtcCI6MTcwOTU4MjIwOTQxN
iwiaWF0IjoxNzA5NTgyMjA5fQ.KCfp3DP-XNKVSZQPjB80nFFcFaGloOoTK88vSfwnFRY",
"reachCount": 500
}
Error Responses
Invalid Authorization
json
{
"success": false,
"error": "Authorization Error",
"message": "You are not authorized to perform this action"
}
Expired session
json
{
"success": false,
"error": "Authorization Error",
"message": "Your session has expired"
}
json
{
"success": false,
"error": "Internal Server Error",
"message": "An unexpected error occurred"
}
Notes
● The user needs to be authenticated.
● Handle error responses the same as previous calls.