Load an Aggregate
By loading all events for a single aggregate we can derive the current state of the Aggregate.
get
https://api.serialized.io
/aggregates/{aggregateType}/{aggregateId}
Load an Aggregate

Examples

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
https://api.serialized.io/aggregates/order/99415be8-6819-4470-860c-c2933558d8d3
Copied!
1
import javax.ws.rs.client.Client;
2
import javax.ws.rs.client.ClientBuilder;
3
import javax.ws.rs.core.UriBuilder;
4
5
Client client = ClientBuilder.newClient();
6
URI apiRoot = URI.create("https://api.serialized.io");
7
8
Map aggregateResponse = client.target(apiRoot)
9
.path("aggregates")
10
.path("order")
11
.path("99415be8-6819-4470-860c-c2933558d8d3")
12
.request()
13
.header("Serialized-Access-Key", "<YOUR_ACCESS_KEY>")
14
.header("Serialized-Secret-Access-Key", "<YOUR_SECRET_ACCESS_KEY>")
15
.get(Map.class);
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/{aggregateId}", Method.GET)
7
.AddUrlSegment("aggregateId", "99415be8-6819-4470-860c-c2933558d8d3")
8
.AddHeader("Serialized-Access-Key", "<YOUR_ACCESS_KEY>")
9
.AddHeader("Serialized-Secret-Access-Key", "<YOUR_SECRET_ACCESS_KEY>");
10
11
var response = client.Execute<Dictionary<string, Object>>(request);
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.get("aggregates/order/99415be8-6819-4470-860c-c2933558d8d3")
10
.then(function (response) {
11
// Handle response
12
})
13
.catch(function (error) {
14
// Handle error
15
});
Copied!