Find Comm
Searches for communication channels by identifier string, optionally filtered by channel type.
Endpoint
POST /v2/comms/find
Request Body
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
identifier | string | Yes | — | AS2 ID, FTP username, or other channel-specific identifier to search for |
commType | NetworkGatewayCommChannel | No | See ENUMs | Narrow results to a specific communication channel type |
{
"identifier": "MYCOMPANY-AS2",
"commType": "as2"
}
Response
Returns an array of matching CommIDInfo objects.
{
"success": true,
"data": [
{
"commId": 5001,
"mailboxId": 101,
"commType": "as2",
"identifier": "MYCOMPANY-AS2",
"status": "Active",
"useType": "Production",
"privateKeyRequired": true,
"withCerts": true
}
]
}
ENUMs
This endpoint uses the NetworkGatewayCommChannel ENUM. See ENUMs Reference for all valid values.
Code Examples
- cURL
- C#
- Java
- Node.js
- Python
curl -X POST "https://rest.ecgrid.io/v2/comms/find" \
-H "X-API-Key: $ECGRID_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "identifier": "MYCOMPANY-AS2", "commType": "as2" }'
// .NET 10 — Search for a comm channel by its AS2 identifier
var request = new
{
identifier = "MYCOMPANY-AS2",
commType = "as2"
};
using var response = await httpClient.PostAsJsonAsync(
"https://rest.ecgrid.io/v2/comms/find",
request);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadFromJsonAsync<ApiResponse<List<CommIdInfo>>>();
foreach (var comm in result.Data)
{
Console.WriteLine($"Found Comm {comm.CommId}: {comm.CommType} — {comm.Identifier} [{comm.Status}]");
}
import java.net.URI;
import java.net.http.*;
String apiKey = System.getenv("ECGRID_API_KEY");
String body = "{ \"identifier\": \"MYCOMPANY-AS2\", \"commType\": \"as2\" }";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://rest.ecgrid.io/v2/comms/find"))
.header("X-API-Key", apiKey)
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(body))
.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/find';
const response = await fetch(url, {
method: 'POST',
headers: {
'X-API-Key': apiKey,
'Content-Type': 'application/json',
},
body: JSON.stringify({ "identifier": "MYCOMPANY-AS2", "commType": "as2" }),
});
const data = await response.json();
console.log(data);
import os, requests
api_key = os.environ["ECGRID_API_KEY"]
headers = {"X-API-Key": api_key}
url = "https://rest.ecgrid.io/v2/comms/find"
response = requests.post(
url,
json={ "identifier": "MYCOMPANY-AS2", "commType": "as2" },
headers=headers,
)
response.raise_for_status()
print(response.json())