It allows you:
to get the Campaigns list to use with API Methods;
Columns that can be used as filters:
Organization
Active
Value
Name
IsSummaryLevel
StartDate
EndDate
Actions can be done:
list
create
update
URL: https://api.socratecloud.com/webapi/rest/campaign/list/{version}?startRow={0}&endRow={100}&accessToken={access_token}
Method: GET
Return: JSON object with next format:
{
"Organization_ID": 0,
"OrganizationValue": "0",
"Organization": "*",
"Created": "2022-07-16 06:47:11+0000",
"CreatedBy": "TESTBEBE_Admin",
"Updated": "2022-07-19 13:08:15+0000",
"UpdatedBy": "TESTBEBE_Admin",
"Active": true,
"Value": "De Martisor",
"Name": "De Martisor",
"Description": null,
"IsSummaryLevel": false,
"StartDate": "2022-07-20 00:00:00+0000",
"EndDate": "2022-08-10 00:00:00+0000",
"Channel_ID": null,
"ChannelName": null,
"Costs": 12345
}
URL: https://api.socratecloud.com/webapi/rest/campaign/create/{version}?accessToken={access_token}
Method: POST
JSON example:
{
"Organization_ID": null,
"OrganizationValue": "XYZ",
"Organization": null,
"Value": "Test Campanie1",
"Name": "Test Name1",
"Description": "Descriere Campanie1",
"Active": null,
"IsSummaryLevel": false,
"StartDate": "2022-07-18 00:00:00+0000",
"EndDate": "2022-11-10 00:00:00+0000",
"Channel_ID": null,
"ChannelName": "Test Channel",
"Costs": 12345
}
Is mandatory: Organization_ID or OrganizationValue or Organization.
Are mandatory: Value, Name, StartDate, Costs.
Return: JSON object with next format:
{
"data": "Test Campanie1",
"id": 1234567
}
If a field is mandatory and is not filled then an error is received:
{
"errorMessage": "The field is mandatory: OrganizationValue",
"isError": true,
"errorCode": 0
}
Another errors:
{
"errorMessage": "Not found active ChannelName for Name 'Test Channel'",
"isError": true,
"errorCode": 0
}
{
"errorMessage": "Faild to create new Campaign: ERROR: duplicate key value violates unique constraint \"c_campaign_value\"\n Detail: Key (ad_client_id, value)=(123344556, Test Campanie1) already exists.",
"isError": true,
"errorCode": 0
}
{
"errorMessage": "Unparseable date: \"2022-07-18 00:00:00\". Supported formats: yyyy-MM-dd HH:mm:ssZ",
"isError": true,
"errorCode": 0
}
URL: https://api.socratecloud.com/webapi/rest/campaign/update/{version}?accessToken={access_token}&Campaign_ID={Campaign_ID}
Parameter 'Campaign_ID' is mandatory.
Method: POST
JSON example:
{
"Organization_ID": 12345,
"OrganizationValue": null,
"Organization": null,
"Value": "Test Campanie2",
"Name": "Test Name2",
"Description": "Descriere Campanie2",
"Active": false,
"IsSummaryLevel": false,
"StartDate": "2022-07-21 00:00:00+0000",
"EndDate": "2022-11-13 00:00:00+0000",
"Channel_ID": 1000476 ,
"ChannelName": "Test Channel2",
"Costs": 432
}
Return: JSON object with next format:
{
"data": "Test Campanie2",
"id": 1234567
}