Patch event rule
1 min
PATCH
https://api.b.preview.loyaltyservices.io/api/v3/event-rules/{eventRuleCode}
Path Parameters
- eventRuleCodestringrequiredDescription
Body Parameters
- bodyEventRulerequired
- eventRuleIdinteger<int64>ExampleDescriptionFormatint64
- eventRuleCodestringExample
- eventRuleNamestringExample
- eventRuleDescriptionstringDescription
- eventTypestringDescription
- startDatestring<date>ExampleFormatdate
- endDatestring<date>ExampleFormatdate
- statusstringDescription
- dataReleaseinteger<int64>DescriptionFormatint64
- dataReleaseNamestringDescription
- dataReleaseItemStatusstringDescription
- workflowStatusstringDescription
- rankintegerDescription
- rawExpressionstringDescription
- resultsEventRuleResult[]Description
- resultTypeCodestringrequiredExampleDescription
- parametersobjectrequiredExample
{ "bonusRuleId": 1234, "bonusRuleCode": "C234" }Description
Responses
200
- EventRule
- eventRuleIdinteger<int64>ExampleDescriptionFormatint64
- eventRuleCodestringExample
- eventRuleNamestringExample
- eventRuleDescriptionstringDescription
- eventTypestringDescription
- startDatestring<date>ExampleFormatdate
- endDatestring<date>ExampleFormatdate
- statusstringDescription
- dataReleaseinteger<int64>DescriptionFormatint64
- dataReleaseNamestringDescription
- dataReleaseItemStatusstringDescription
- workflowStatusstringDescription
- rankintegerDescription
- rawExpressionstringDescription
- resultsEventRuleResult[]Description
- resultTypeCodestringrequiredExampleDescription
- parametersobjectrequiredExample
{ "bonusRuleId": 1234, "bonusRuleCode": "C234" }Description
- allowedActionsRuleAllowedActionsDescription
- modifybooleanDescription
- managebooleanDescription
- adminbooleanDescription
- deletebooleanDescription
400
- ErrorResponse
- errorsValidationError[]Description
- codestringDescription
- fieldNamestringDescription
- messagestringDescription
- messageParametersobject[]Description
401
403
500
curl
curl --request PATCH \
--url https://api.b.preview.loyaltyservices.io/api/v3/event-rules/{eventRuleCode} \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"results": [
{
"resultTypeCode": "Bonus",
"parameters": "{\"bonusRuleId\":1234,\"bonusRuleCode\":\"C234\"}"
}
]
}'ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.b.preview.loyaltyservices.io/api/v3/event-rules/{eventRuleCode}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request.body = JSON.dump({
"results": [
{
"resultTypeCode": "Bonus",
"parameters": "{\"bonusRuleId\":1234,\"bonusRuleCode\":\"C234\"}"
}
]
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.b.preview.loyaltyservices.io/api/v3/event-rules/{eventRuleCode}"
payload = json.dumps({
"results": [
{
"resultTypeCode": "Bonus",
"parameters": "{\"bonusRuleId\":1234,\"bonusRuleCode\":\"C234\"}"
}
]
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text)
java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"results\": [\n {\n \"resultTypeCode\": \"Bonus\",\n \"parameters\": \"{\\\"bonusRuleId\\\":1234,\\\"bonusRuleCode\\\":\\\"C234\\\"}\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("https://api.b.preview.loyaltyservices.io/api/v3/event-rules/{eventRuleCode}")
.method("PATCH", body)
.addHeader("accept", "application/json")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();200
// Success
{
"eventRuleId": 97432,
"eventRuleCode": "Event233",
"eventRuleName": "TestEvent123",
"eventRuleDescription": "",
"eventType": "",
"startDate": "2024-03-20",
"endDate": "2024-03-20",
"status": "",
"dataRelease": "",
"dataReleaseName": "",
"dataReleaseItemStatus": "",
"workflowStatus": "",
"rank": 0,
"rawExpression": "",
"results": [
{
"resultTypeCode": "Bonus",
"parameters": {}
}
],
"allowedActions": {
"modify": false,
"manage": false,
"admin": false,
"delete": false
}
}400
// Bad request
{
"errors": [
{
"code": "",
"fieldName": "",
"message": "",
"messageParameters": [
{}
]
}
]
}401
// Unauthorized
403
// Forbidden
500
// Internal server error