Deactivate a subscription discount - Fabric
Deactivate a subscription discount
cURL
curl --request PATCH \
--url https://prod01.copilot.fabric.inc/data-subscription/v1/subscriptionDiscount/deactivate/{id} \
--header 'Authorization: Bearer <token>'
Python
import requests
url = "https://prod01.copilot.fabric.inc/data-subscription/v1/subscriptionDiscount/deactivate/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.patch(url, headers=headers)
print(response.text)
JavaScript (Fetch)
const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};
fetch('https://prod01.copilot.fabric.inc/data-subscription/v1/subscriptionDiscount/deactivate/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://prod01.copilot.fabric.inc/data-subscription/v1/subscriptionDiscount/deactivate/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
?>
Go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://prod01.copilot.fabric.inc/data-subscription/v1/subscriptionDiscount/deactivate/{id}"
req, _ := http.NewRequest("PATCH", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
Unirest (Java)
HttpResponse<String> response = Unirest.patch("https://prod01.copilot.fabric.inc/data-subscription/v1/subscriptionDiscount/deactivate/{id}")
.header("Authorization", "Bearer <token>")
.asString();
Ruby
require 'uri'
require 'net/http'
url = URI("https://prod01.copilot.fabric.inc/data-subscription/v1/subscriptionDiscount/deactivate/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body
Responses
| Status Code |
Response |
| 200 |
{ "responseStatus": "OK", "message": "Request processed successfully", "data": { ... } } |
| 400 |
{ "responseStatus": "BAD_REQUEST", "message": "Bad request" } |
| 403 |
{ "Message": "User is not authorized..." } |
| 404 |
{ "responseStatus": "NOT_FOUND", "message": "Not found" } |
Authorizations
- Authorization: Required. String in the header of the form
Bearer <token>.
Path Parameters
- id: Required. String representing the Discount ID.
General Response Structure
- responseStatus: Brief response status (e.g., "OK").
- message: Full response message (e.g., "Request processed successfully").
- data: Contains discount details after deactivation.