Add Tenant
post
https://api.serialized.io
/tenants
Add Tenant

Example

cURL
Java
C#
Node
1
curl -i https://api.serialized.io/tenants \
2
--header "Content-Type: application/json" \
3
--header "Serialized-Access-Key: <YOUR_ACCESS_KEY>" \
4
--header "Serialized-Secret-Access-Key: <YOUR_SECRET_ACCESS_KEY>" \
5
--data '
6
{
7
"tenantId": "e9ef574f-4563-4d56-ad9e-0a2d5ce42004",
8
"reference": "Acme Inc"
9
}
10
'
Copied!
1
import com.google.common.collect.ImmutableMap;
2
import javax.ws.rs.client.Client;
3
import javax.ws.rs.client.ClientBuilder;
4
5
Client client = ClientBuilder.newClient();
6
URI apiRoot = URI.create("https://api.serialized.io");
7
8
Map<String, Object> tenant = ImmutableMap.of(
9
"tenantId", "e9ef574f-4563-4d56-ad9e-0a2d5ce42004",
10
"reference", "Acme Inc"
11
);
12
13
Response response = client.target(apiRoot)
14
.path("tenants")
15
.request()
16
.header("Serialized-Access-Key", "<YOUR_ACCESS_KEY>")
17
.header("Serialized-Secret-Access-Key", "<YOUR_SECRET_ACCESS_KEY>")
18
.post(Entity.json(tenant));
Copied!
1
using System;
2
using System.Collections.Generic;
3
using RestSharp;
4
5
var tenant = new Dictionary<string, Object>
6
{
7
{ "tenantId", "e9ef574f-4563-4d56-ad9e-0a2d5ce42004" },
8
{ "reference", "Acme Inc" }
9
};
10
11
var client = new RestClient("https://api.serialized.io");
12
13
var request = new RestRequest("tenants", Method.POST)
14
.AddHeader("Serialized-Access-Key", "<YOUR_ACCESS_KEY>")
15
.AddHeader("Serialized-Secret-Access-Key", "<YOUR_SECRET_ACCESS_KEY>");
16
.AddJsonBody(tenant);
17
18
var response = client.Execute(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
const definition = {
10
tenantId: "e9ef574f-4563-4d56-ad9e-0a2d5ce42004",
11
reference: "Acme Inc"
12
};
13
14
client.post("tenants", definition)
15
.then(function (response) {
16
// Handle response
17
})
18
.catch(function (error) {
19
// Handle error
20
});
Copied!
Last modified 9mo ago
Copy link