Get Comm
Retrieves the details of a specific communication channel (Comm) by its unique ID.
Endpoint
GET /v2/comms/{id}
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | Unique identifier of the communication channel |
Response
Returns the full CommIDInfo object for the specified communication channel.
{
"success": true,
"data": {
"commId": 5001,
"mailboxId": 101,
"commType": "as2",
"identifier": "MYCOMPANY-AS2",
"status": "Active",
"useType": "Production",
"privateKeyRequired": true,
"withCerts": true
}
}
ENUMs
This endpoint returns values from the NetworkGatewayCommChannel, Status, and UseType ENUMs. See ENUMs Reference for all valid values.
Code Examples
- cURL
- C#
- Java
- Node.js
- Python
curl -X GET "https://rest.ecgrid.io/v2/comms/$ID" \
-H "X-API-Key: $ECGRID_API_KEY"
// .NET 10 — Retrieve a communication channel by ID
using var response = await httpClient.GetAsync(
$"https://rest.ecgrid.io/v2/comms/{commId}");
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadFromJsonAsync<ApiResponse<CommIdInfo>>();
Console.WriteLine($"Comm {result.Data.CommId}: Type={result.Data.CommType}, Identifier={result.Data.Identifier}, Status={result.Data.Status}");
import java.net.URI;
import java.net.http.*;
String apiKey = System.getenv("ECGRID_API_KEY");
String id = "0"; // replace with actual id
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(String.format("https://rest.ecgrid.io/v2/comms/%s", id)))
.header("X-API-Key", apiKey)
.GET()
.build();
HttpClient client = HttpClient.newHttpClient();
HttpResponse<String> response = client.send(
request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
const apiKey = process.env.ECGRID_API_KEY;
const url = `https://rest.ecgrid.io/v2/comms/${id}`;
const response = await fetch(url, {
method: 'GET',
headers: { 'X-API-Key': apiKey },
});
const data = await response.json();
console.log(data);
import os, requests
api_key = os.environ["ECGRID_API_KEY"]
headers = {"X-API-Key": api_key}
id = 0 # replace with actual id
url = f"https://rest.ecgrid.io/v2/comms/{id}"
response = requests.get(url, headers=headers)
response.raise_for_status()
print(response.json())