Campaign
Update campaign
If the campaign does not exist, it will be created. Partial updates are not supported.
Parameters for "Update campaign"
PUT/API/Campaign/{id}
Request Example
curl -X PUT 'https://mgmtapi.geins.io/API/Campaign/{id}' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic [USER-CREDENTIALS-BASE64-ENCODED]' \
-H 'X-ApiKey: {MGMT_API_KEY}'\
-d '{
"CampaignId": "00000000-0000-0000-0000-000000000000",
"CampaignBaseType": 0,
"Title": [
{
"Language": "string",
"Value": "string"
}
],
"Description": "string",
"MarketId": "string",
"CampaignTypeId": 0,
"BuyQuantity": 0,
"Amounts": {},
"PayForQuantity": 0,
"Priority": 0,
"StopCombining": true,
"ValidFrom": "string",
"ValidTo": "string",
"PromoCode": "string",
"HideTitle": true,
"CantCombineWithCartCampaign": true,
"PercentageValue": 0,
"ExcludeProductsOnSale": true,
"SaleTypesToEnforce": 0,
"MinimumPurchaseAmounts": {},
"MinimumQuantity": 0,
"CheckMinAmountAfterDiscounts": true,
"Scoped": true,
"OncePerCustomer": true,
"UseSalePrice": true,
"FreeShipping": true,
"UsageLimit": 0,
"Prices": {},
"LandingPage": {
"Title": [
{
"Language": "string",
"Value": "string"
}
],
"Url": [
{
"Values": [
"string"
],
"Language": "string",
"Value": "string"
}
],
"Description": [
{
"Language": "string",
"Value": "string"
}
],
"Meta": {
"Title": [
{
"Language": "string",
"Value": "string"
}
],
"Keywords": [
{
"Language": "string",
"Value": "string"
}
],
"Description": [
{
"Language": "string",
"Value": "string"
}
]
}
},
"SelectedUsers": [
"string"
],
"SelectedGroups": [
"string"
],
"Enabled": true,
"ProductSelection": {
"Include": {
"Condition": 0,
"Categories": [
{
"Id": 0,
"Name": "string"
}
],
"Brands": [
{
"Id": 0,
"Name": "string"
}
],
"Products": [
0
],
"Price": [
{
"Condition": 0,
"Prices": {}
}
]
},
"Exclude": {
"Condition": 0,
"Categories": [
{
"Id": 0,
"Name": "string"
}
],
"Brands": [
{
"Id": 0,
"Name": "string"
}
],
"Products": [
0
],
"Price": [
{
"Condition": 0,
"Prices": {}
}
]
}
},
"Group": "string",
"PriceOutput": 0
}'
import axios from 'axios';
const config = {
method: 'PUT',
url: 'https://mgmtapi.geins.io/API/Campaign/{id}',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Basic [USER-CREDENTIALS-BASE64-ENCODED]',
'X-ApiKey': '{MGMT_API_KEY}'
},
data: {
"CampaignId": "00000000-0000-0000-0000-000000000000",
"CampaignBaseType": 0,
"Title": [
{
"Language": "string",
"Value": "string"
}
],
"Description": "string",
"MarketId": "string",
"CampaignTypeId": 0,
"BuyQuantity": 0,
"Amounts": {},
"PayForQuantity": 0,
"Priority": 0,
"StopCombining": true,
"ValidFrom": "string",
"ValidTo": "string",
"PromoCode": "string",
"HideTitle": true,
"CantCombineWithCartCampaign": true,
"PercentageValue": 0,
"ExcludeProductsOnSale": true,
"SaleTypesToEnforce": 0,
"MinimumPurchaseAmounts": {},
"MinimumQuantity": 0,
"CheckMinAmountAfterDiscounts": true,
"Scoped": true,
"OncePerCustomer": true,
"UseSalePrice": true,
"FreeShipping": true,
"UsageLimit": 0,
"Prices": {},
"LandingPage": {
"Title": [
{
"Language": "string",
"Value": "string"
}
],
"Url": [
{
"Values": [
"string"
],
"Language": "string",
"Value": "string"
}
],
"Description": [
{
"Language": "string",
"Value": "string"
}
],
"Meta": {
"Title": [
{
"Language": "string",
"Value": "string"
}
],
"Keywords": [
{
"Language": "string",
"Value": "string"
}
],
"Description": [
{
"Language": "string",
"Value": "string"
}
]
}
},
"SelectedUsers": [
"string"
],
"SelectedGroups": [
"string"
],
"Enabled": true,
"ProductSelection": {
"Include": {
"Condition": 0,
"Categories": [
{
"Id": 0,
"Name": "string"
}
],
"Brands": [
{
"Id": 0,
"Name": "string"
}
],
"Products": [
0
],
"Price": [
{
"Condition": 0,
"Prices": {}
}
]
},
"Exclude": {
"Condition": 0,
"Categories": [
{
"Id": 0,
"Name": "string"
}
],
"Brands": [
{
"Id": 0,
"Name": "string"
}
],
"Products": [
0
],
"Price": [
{
"Condition": 0,
"Prices": {}
}
]
}
},
"Group": "string",
"PriceOutput": 0
}
};
axios.request(config)
.then(response => response.data)
.catch(error => console.error(error));
fetch('https://mgmtapi.geins.io/API/Campaign/{id}', {
method: 'PUT',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Basic [USER-CREDENTIALS-BASE64-ENCODED]',
'X-ApiKey': '{MGMT_API_KEY}'
},
body: JSON.stringify({
"CampaignId": "00000000-0000-0000-0000-000000000000",
"CampaignBaseType": 0,
"Title": [
{
"Language": "string",
"Value": "string"
}
],
"Description": "string",
"MarketId": "string",
"CampaignTypeId": 0,
"BuyQuantity": 0,
"Amounts": {},
"PayForQuantity": 0,
"Priority": 0,
"StopCombining": true,
"ValidFrom": "string",
"ValidTo": "string",
"PromoCode": "string",
"HideTitle": true,
"CantCombineWithCartCampaign": true,
"PercentageValue": 0,
"ExcludeProductsOnSale": true,
"SaleTypesToEnforce": 0,
"MinimumPurchaseAmounts": {},
"MinimumQuantity": 0,
"CheckMinAmountAfterDiscounts": true,
"Scoped": true,
"OncePerCustomer": true,
"UseSalePrice": true,
"FreeShipping": true,
"UsageLimit": 0,
"Prices": {},
"LandingPage": {
"Title": [
{
"Language": "string",
"Value": "string"
}
],
"Url": [
{
"Values": [
"string"
],
"Language": "string",
"Value": "string"
}
],
"Description": [
{
"Language": "string",
"Value": "string"
}
],
"Meta": {
"Title": [
{
"Language": "string",
"Value": "string"
}
],
"Keywords": [
{
"Language": "string",
"Value": "string"
}
],
"Description": [
{
"Language": "string",
"Value": "string"
}
]
}
},
"SelectedUsers": [
"string"
],
"SelectedGroups": [
"string"
],
"Enabled": true,
"ProductSelection": {
"Include": {
"Condition": 0,
"Categories": [
{
"Id": 0,
"Name": "string"
}
],
"Brands": [
{
"Id": 0,
"Name": "string"
}
],
"Products": [
0
],
"Price": [
{
"Condition": 0,
"Prices": {}
}
]
},
"Exclude": {
"Condition": 0,
"Categories": [
{
"Id": 0,
"Name": "string"
}
],
"Brands": [
{
"Id": 0,
"Name": "string"
}
],
"Products": [
0
],
"Price": [
{
"Condition": 0,
"Prices": {}
}
]
}
},
"Group": "string",
"PriceOutput": 0
})
})
.then(res => res.json())
.then((response) => response)
.catch(console.error);
import requests
url = "https://mgmtapi.geins.io/API/Campaign/{id}"
headers = {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Basic [USER-CREDENTIALS-BASE64-ENCODED]',
'X-ApiKey': '{MGMT_API_KEY}'
}
payload = {
"CampaignId": "00000000-0000-0000-0000-000000000000",
"CampaignBaseType": 0,
"Title": [
{
"Language": "string",
"Value": "string"
}
],
"Description": "string",
"MarketId": "string",
"CampaignTypeId": 0,
"BuyQuantity": 0,
"Amounts": {},
"PayForQuantity": 0,
"Priority": 0,
"StopCombining": true,
"ValidFrom": "string",
"ValidTo": "string",
"PromoCode": "string",
"HideTitle": true,
"CantCombineWithCartCampaign": true,
"PercentageValue": 0,
"ExcludeProductsOnSale": true,
"SaleTypesToEnforce": 0,
"MinimumPurchaseAmounts": {},
"MinimumQuantity": 0,
"CheckMinAmountAfterDiscounts": true,
"Scoped": true,
"OncePerCustomer": true,
"UseSalePrice": true,
"FreeShipping": true,
"UsageLimit": 0,
"Prices": {},
"LandingPage": {
"Title": [
{
"Language": "string",
"Value": "string"
}
],
"Url": [
{
"Values": [
"string"
],
"Language": "string",
"Value": "string"
}
],
"Description": [
{
"Language": "string",
"Value": "string"
}
],
"Meta": {
"Title": [
{
"Language": "string",
"Value": "string"
}
],
"Keywords": [
{
"Language": "string",
"Value": "string"
}
],
"Description": [
{
"Language": "string",
"Value": "string"
}
]
}
},
"SelectedUsers": [
"string"
],
"SelectedGroups": [
"string"
],
"Enabled": true,
"ProductSelection": {
"Include": {
"Condition": 0,
"Categories": [
{
"Id": 0,
"Name": "string"
}
],
"Brands": [
{
"Id": 0,
"Name": "string"
}
],
"Products": [
0
],
"Price": [
{
"Condition": 0,
"Prices": {}
}
]
},
"Exclude": {
"Condition": 0,
"Categories": [
{
"Id": 0,
"Name": "string"
}
],
"Brands": [
{
"Id": 0,
"Name": "string"
}
],
"Products": [
0
],
"Price": [
{
"Condition": 0,
"Prices": {}
}
]
}
},
"Group": "string",
"PriceOutput": 0
}
response = requests.PUT(url, json=payload, headers=headers)
print(response.json())
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
url := "https://mgmtapi.geins.io/API/Campaign/{id}"
payload := []byte(`{
"CampaignId": "00000000-0000-0000-0000-000000000000",
"CampaignBaseType": 0,
"Title": [
{
"Language": "string",
"Value": "string"
}
],
"Description": "string",
"MarketId": "string",
"CampaignTypeId": 0,
"BuyQuantity": 0,
"Amounts": {},
"PayForQuantity": 0,
"Priority": 0,
"StopCombining": true,
"ValidFrom": "string",
"ValidTo": "string",
"PromoCode": "string",
"HideTitle": true,
"CantCombineWithCartCampaign": true,
"PercentageValue": 0,
"ExcludeProductsOnSale": true,
"SaleTypesToEnforce": 0,
"MinimumPurchaseAmounts": {},
"MinimumQuantity": 0,
"CheckMinAmountAfterDiscounts": true,
"Scoped": true,
"OncePerCustomer": true,
"UseSalePrice": true,
"FreeShipping": true,
"UsageLimit": 0,
"Prices": {},
"LandingPage": {
"Title": [
{
"Language": "string",
"Value": "string"
}
],
"Url": [
{
"Values": [
"string"
],
"Language": "string",
"Value": "string"
}
],
"Description": [
{
"Language": "string",
"Value": "string"
}
],
"Meta": {
"Title": [
{
"Language": "string",
"Value": "string"
}
],
"Keywords": [
{
"Language": "string",
"Value": "string"
}
],
"Description": [
{
"Language": "string",
"Value": "string"
}
]
}
},
"SelectedUsers": [
"string"
],
"SelectedGroups": [
"string"
],
"Enabled": true,
"ProductSelection": {
"Include": {
"Condition": 0,
"Categories": [
{
"Id": 0,
"Name": "string"
}
],
"Brands": [
{
"Id": 0,
"Name": "string"
}
],
"Products": [
0
],
"Price": [
{
"Condition": 0,
"Prices": {}
}
]
},
"Exclude": {
"Condition": 0,
"Categories": [
{
"Id": 0,
"Name": "string"
}
],
"Brands": [
{
"Id": 0,
"Name": "string"
}
],
"Products": [
0
],
"Price": [
{
"Condition": 0,
"Prices": {}
}
]
}
},
"Group": "string",
"PriceOutput": 0
}`)
req, _ := http.NewRequest("PUT", url, bytes.NewBuffer(payload))
req.Header.Add("Accept", "application/json")
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Basic [USER-CREDENTIALS-BASE64-ENCODED]")
req.Header.Add("X-ApiKey", "{MGMT_API_KEY}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
using System.Text;
using System.Text.Json;
using System.Net.Http;
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Basic [USER-CREDENTIALS-BASE64-ENCODED]");
client.DefaultRequestHeaders.Add("X-ApiKey", "{MGMT_API_KEY}");
var body = new
{
CampaignId = "00000000-0000-0000-0000-000000000000",
CampaignBaseType = 0,
Title = new[]
{
new
{
Language = "string",
Value = "string"
}
},
Description = "string",
MarketId = "string",
CampaignTypeId = 0,
BuyQuantity = 0,
Amounts = new
{
},
PayForQuantity = 0,
Priority = 0,
StopCombining = true,
ValidFrom = "string",
ValidTo = "string",
PromoCode = "string",
HideTitle = true,
CantCombineWithCartCampaign = true,
PercentageValue = 0,
ExcludeProductsOnSale = true,
SaleTypesToEnforce = 0,
MinimumPurchaseAmounts = new
{
},
MinimumQuantity = 0,
CheckMinAmountAfterDiscounts = true,
Scoped = true,
OncePerCustomer = true,
UseSalePrice = true,
FreeShipping = true,
UsageLimit = 0,
Prices = new
{
},
LandingPage = new
{
Title = new[]
{
new
{
Language = "string",
Value = "string"
}
},
Url = new[]
{
new
{
Values = new[]
{
"string"
},
Language = "string",
Value = "string"
}
},
Description = new[]
{
new
{
Language = "string",
Value = "string"
}
},
Meta = new
{
Title = new[]
{
new
{
Language = "string",
Value = "string"
}
},
Keywords = new[]
{
new
{
Language = "string",
Value = "string"
}
},
Description = new[]
{
new
{
Language = "string",
Value = "string"
}
}
}
},
SelectedUsers = new[]
{
"string"
},
SelectedGroups = new[]
{
"string"
},
Enabled = true,
ProductSelection = new
{
Include = new
{
Condition = 0,
Categories = new[]
{
new
{
Id = 0,
Name = "string"
}
},
Brands = new[]
{
new
{
Id = 0,
Name = "string"
}
},
Products = new[]
{
0
},
Price = new[]
{
new
{
Condition = 0,
Prices = new
{
}
}
}
},
Exclude = new
{
Condition = 0,
Categories = new[]
{
new
{
Id = 0,
Name = "string"
}
},
Brands = new[]
{
new
{
Id = 0,
Name = "string"
}
},
Products = new[]
{
0
},
Price = new[]
{
new
{
Condition = 0,
Prices = new
{
}
}
}
}
},
Group = "string",
PriceOutput = 0
};
var jsonContent = JsonSerializer.Serialize(body);
var content = new StringContent(jsonContent, Encoding.UTF8, "application/json");
var response = await client.PUTAsync("https://mgmtapi.geins.io/API/Campaign/{id}", content);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
Response
{
"Message": "string",
"Details": [
"string"
]
}
{
"Message": "string",
"Details": [
"string"
]
}