Delete Earning Rule
1 min
DELETE
https://api.b.preview.loyaltyservices.io/api/v3/earning-rules/{name}
Path Parameters
- namestringrequiredDescriptionMax Length50
Responses
200
400
- ErrorResponse
- errorsValidationError[]Description
- codestringDescription
- fieldNamestringDescription
- messagestringDescription
- messageParametersobject[]Description
401
403
404
500
curl
curl --request DELETE \
--url https://api.b.preview.loyaltyservices.io/api/v3/earning-rules/{name} \
--header 'accept: application/json'ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.b.preview.loyaltyservices.io/api/v3/earning-rules/{name}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.b.preview.loyaltyservices.io/api/v3/earning-rules/{name}"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("DELETE", 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, "");
Request request = new Request.Builder()
.url("https://api.b.preview.loyaltyservices.io/api/v3/earning-rules/{name}")
.method("DELETE", body)
.addHeader("accept", "application/json")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();200
// Success
400
// Bad request
{
"errors": [
{
"code": "",
"fieldName": "",
"message": "",
"messageParameters": [
{}
]
}
]
}401
// Unauthorized
403
// Forbidden
404
// Not found
500
// Internal error