Delete all Aggregates by type
delete
https://api.serialized.io
/aggregates/{aggregateType}
Delete all aggregates by type

Example

This example requests a delete token for deleting all aggregates for a given type
cURL
Java
C#
Node
1
curl -i \
2
--header "Serialized-Access-Key: <YOUR_ACCESS_KEY>" \
3
--header "Serialized-Secret-Access-Key: <YOUR_SECRET_ACCESS_KEY>" \
4
-X DELETE https://api.serialized.io/aggregates/order
Copied!
1
import javax.ws.rs.client.Client;
2
import javax.ws.rs.client.ClientBuilder;
3
4
Client client = ClientBuilder.newClient();
5
URI apiRoot = URI.create("https://api.serialized.io");
6
7
Map response = client.target(apiRoot)
8
.path("aggregates")
9
.path("order")
10
.request()
11
.header("Serialized-Access-Key", "<YOUR_ACCESS_KEY>")
12
.header("Serialized-Secret-Access-Key", "<YOUR_SECRET_ACCESS_KEY>")
13
.delete(Map.class);
14
15
String deleteToken = (String) response.get("deleteToken");
Copied!
1
using RestSharp;
2
using System;
3
4
var client = new RestClient("https://api.serialized.io");
5
6
var request = new RestRequest("aggregates/order", Method.DELETE)
7
.AddHeader("Serialized-Access-Key", "<YOUR_ACCESS_KEY>")
8
.AddHeader("Serialized-Secret-Access-Key", "<YOUR_SECRET_ACCESS_KEY>");
9
10
var response = client.Execute<Dictionary<string, Object>>(request);
11
var deleteToken = response.Data["deleteToken"]
Copied!
1
const axios = require("axios");
2
3
const client = axios.create({
4
baseURL: "https://api.serialized.io",
5
headers: {"Serialized-Access-Key": "<YOUR_ACCESS_KEY>"},
6
headers: {"Serialized-Secret-Access-Key": "<YOUR_SECRET_ACCESS_KEY>"}
7
});
8
9
client.delete("aggregates/order")
10
.then(function (response) {
11
const deleteToken = response.data.deleteToken;
12
// Use deleteToken
13
})
14
.catch(function (error) {
15
// Handle error
16
});
Copied!

Permanently deleting the aggregate type using the delete token

This example permanently deletes an aggregate type using a delete token that was returned in the response to the preceding delete request.
This is a permanent request that cannot be undone. If you need to be able to restore this data in any way you must back it up on your side before executing the deletion.
cURL
Java
C#
Node
1
curl -i \
2
--header "Serialized-Access-Key: <YOUR_ACCESS_KEY>" \
3
--header "Serialized-Secret-Access-Key: <YOUR_SECRET_ACCESS_KEY>" \
4
-X DELETE https://api.serialized.io/aggregates/order?deleteToken=12c3780f-2dcb-340f-5532-5693be83f21c
Copied!
1
Response delete = client.target(apiRoot)
2
.path("aggregates")
3
.path("order")
4
.queryParam("deleteToken", deleteToken)
5
.request()
6
.header("Serialized-Access-Key", "<YOUR_ACCESS_KEY>")
7
.header("Serialized-Secret-Access-Key", "<YOUR_SECRET_ACCESS_KEY>")
8
.delete();
Copied!
1
var request = new RestRequest("aggregates/order", Method.DELETE)
2
.AddHeader("Serialized-Access-Key", "<YOUR_ACCESS_KEY>")
3
.AddHeader("Serialized-Secret-Access-Key", "<YOUR_SECRET_ACCESS_KEY>")
4
.AddQueryParameter("deleteToken", deleteToken);
5
6
var response = client.Execute<Dictionary<string, Object>>(request);
Copied!
1
const requestConfig = {
2
params: {
3
deleteToken: deleteToken
4
}
5
};
6
7
client.delete("aggregates/order", requestConfig)
8
.then(function (response) {
9
// Handle response
10
})
11
.catch(function (error) {
12
// Handle error
13
});
Copied!
Last modified 1yr ago