Assign network to group
curl --request POST \
--url https://api.spirii.com/emsp/v1/token-groups/{groupId}/networks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"network_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.spirii.com/emsp/v1/token-groups/{groupId}/networks"
payload = { "network_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({network_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://api.spirii.com/emsp/v1/token-groups/{groupId}/networks', 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://api.spirii.com/emsp/v1/token-groups/{groupId}/networks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'network_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.spirii.com/emsp/v1/token-groups/{groupId}/networks"
payload := strings.NewReader("{\n \"network_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.spirii.com/emsp/v1/token-groups/{groupId}/networks")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"network_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spirii.com/emsp/v1/token-groups/{groupId}/networks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"network_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"group_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"network_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"network_name": "<string>",
"parent_network_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"assigned_at": "2023-11-07T05:31:56Z",
"assigned_by": "<string>",
"emsp_identity_id": "<string>"
}{
"type": "/errors/validation-failed",
"title": "Validation Failed",
"status": 422,
"detail": "<string>",
"error_code": "RESOURCE_NOT_FOUND",
"correlation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"retry_after_seconds": 2,
"errors": [
{
"field": "body.tokens[3].uid",
"code": "INVALID_ENUM",
"message": "<string>"
}
]
}{
"message": "<string>"
}{
"type": "/errors/validation-failed",
"title": "Validation Failed",
"status": 422,
"detail": "<string>",
"error_code": "RESOURCE_NOT_FOUND",
"correlation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"retry_after_seconds": 2,
"errors": [
{
"field": "body.tokens[3].uid",
"code": "INVALID_ENUM",
"message": "<string>"
}
]
}{
"type": "/errors/validation-failed",
"title": "Validation Failed",
"status": 422,
"detail": "<string>",
"error_code": "RESOURCE_NOT_FOUND",
"correlation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"retry_after_seconds": 2,
"errors": [
{
"field": "body.tokens[3].uid",
"code": "INVALID_ENUM",
"message": "<string>"
}
]
}{
"type": "/errors/validation-failed",
"title": "Validation Failed",
"status": 422,
"detail": "<string>",
"error_code": "RESOURCE_NOT_FOUND",
"correlation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"retry_after_seconds": 2,
"errors": [
{
"field": "body.tokens[3].uid",
"code": "INVALID_ENUM",
"message": "<string>"
}
]
}{
"type": "/errors/validation-failed",
"title": "Validation Failed",
"status": 422,
"detail": "<string>",
"error_code": "RESOURCE_NOT_FOUND",
"correlation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"retry_after_seconds": 2,
"errors": [
{
"field": "body.tokens[3].uid",
"code": "INVALID_ENUM",
"message": "<string>"
}
]
}{
"message": "<string>"
}{
"type": "/errors/validation-failed",
"title": "Validation Failed",
"status": 422,
"detail": "<string>",
"error_code": "RESOURCE_NOT_FOUND",
"correlation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"retry_after_seconds": 2,
"errors": [
{
"field": "body.tokens[3].uid",
"code": "INVALID_ENUM",
"message": "<string>"
}
]
}Assign network to group
Assigns a network to the group, so member tokens can charge on the CPOs it contains. Every network a token reaches, across all of its groups, must be built on the same BASE network.
Requires the emsp:tokens:write scope.
POST
/
emsp
/
v1
/
token-groups
/
{groupId}
/
networks
Assign network to group
curl --request POST \
--url https://api.spirii.com/emsp/v1/token-groups/{groupId}/networks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"network_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.spirii.com/emsp/v1/token-groups/{groupId}/networks"
payload = { "network_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({network_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://api.spirii.com/emsp/v1/token-groups/{groupId}/networks', 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://api.spirii.com/emsp/v1/token-groups/{groupId}/networks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'network_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.spirii.com/emsp/v1/token-groups/{groupId}/networks"
payload := strings.NewReader("{\n \"network_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.spirii.com/emsp/v1/token-groups/{groupId}/networks")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"network_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spirii.com/emsp/v1/token-groups/{groupId}/networks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"network_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"group_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"network_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"network_name": "<string>",
"parent_network_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"assigned_at": "2023-11-07T05:31:56Z",
"assigned_by": "<string>",
"emsp_identity_id": "<string>"
}{
"type": "/errors/validation-failed",
"title": "Validation Failed",
"status": 422,
"detail": "<string>",
"error_code": "RESOURCE_NOT_FOUND",
"correlation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"retry_after_seconds": 2,
"errors": [
{
"field": "body.tokens[3].uid",
"code": "INVALID_ENUM",
"message": "<string>"
}
]
}{
"message": "<string>"
}{
"type": "/errors/validation-failed",
"title": "Validation Failed",
"status": 422,
"detail": "<string>",
"error_code": "RESOURCE_NOT_FOUND",
"correlation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"retry_after_seconds": 2,
"errors": [
{
"field": "body.tokens[3].uid",
"code": "INVALID_ENUM",
"message": "<string>"
}
]
}{
"type": "/errors/validation-failed",
"title": "Validation Failed",
"status": 422,
"detail": "<string>",
"error_code": "RESOURCE_NOT_FOUND",
"correlation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"retry_after_seconds": 2,
"errors": [
{
"field": "body.tokens[3].uid",
"code": "INVALID_ENUM",
"message": "<string>"
}
]
}{
"type": "/errors/validation-failed",
"title": "Validation Failed",
"status": 422,
"detail": "<string>",
"error_code": "RESOURCE_NOT_FOUND",
"correlation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"retry_after_seconds": 2,
"errors": [
{
"field": "body.tokens[3].uid",
"code": "INVALID_ENUM",
"message": "<string>"
}
]
}{
"type": "/errors/validation-failed",
"title": "Validation Failed",
"status": 422,
"detail": "<string>",
"error_code": "RESOURCE_NOT_FOUND",
"correlation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"retry_after_seconds": 2,
"errors": [
{
"field": "body.tokens[3].uid",
"code": "INVALID_ENUM",
"message": "<string>"
}
]
}{
"message": "<string>"
}{
"type": "/errors/validation-failed",
"title": "Validation Failed",
"status": 422,
"detail": "<string>",
"error_code": "RESOURCE_NOT_FOUND",
"correlation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"retry_after_seconds": 2,
"errors": [
{
"field": "body.tokens[3].uid",
"code": "INVALID_ENUM",
"message": "<string>"
}
]
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Headers
Client-generated unique key per operation intent (UUID). Same key + identical body replays the original response; same key + different body returns 409.
Path Parameters
The token group group_id
Body
application/json
The network to assign
Response
The new network assignment
Display name of the network
The BASE network this network is built on
When the network was assigned
Who assigned the network
The EMSP identity the network belongs to
Required string length:
1 - 64Was this page helpful?