Delete specific redemption record - Fabric
Delete specific redemption record
cURL
curl --request DELETE \
--url https://live.copilot.fabric.inc/api-offers/redemption/{redemptionId} \
--header 'Authorization: Bearer <token>' \
--header 'x-site-context: <x-site-context>'
Python
import requests
url = "https://live.copilot.fabric.inc/api-offers/redemption/{redemptionId}"
headers = {
"x-site-context": "<x-site-context>",
"Authorization": "Bearer <token>"
}
response = requests.delete(url, headers=headers)
print(response.text)
JavaScript (Fetch)
const options = {
method: 'DELETE',
headers: {'x-site-context': '<x-site-context>', Authorization: 'Bearer <token>'}
};
fetch('https://live.copilot.fabric.inc/api-offers/redemption/{redemptionId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
PHP
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://live.copilot.fabric.inc/api-offers/redemption/{redemptionId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"x-site-context: <x-site-context>"
],
]);
$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://live.copilot.fabric.inc/api-offers/redemption/{redemptionId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-site-context", "<x-site-context>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
Response Codes
200: Success
404: Redemption not found
500: Internal server error
Example Responses
Successful Deletion
{
"redemptionId": "614b58924e92f6861ac9d43b",
"deleted": true
}
Redemption Not Found
{
"code": "REDEMPTION_NOT_FOUND",
"message": "The redemption record doesn't exist."
}
Internal Server Error
{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error."
}
Authorizations
- Authorization: Required header of the form
Bearer <token>
Headers
- x-site-context: Required header containing context information. Example:
"{\"date\": \"2023-01-01T00:00:00.000Z\", \"channel\": 12, \"account\": \"1234abcd5678efgh9ijklmno\",\"stage\":\"production\"}"
Path Parameters
- redemptionId: Required ID of the redemption record to be deleted. Example: "614b58924e92f6861ac9d43b"