Comm Pair
Returns the communication path between two ECGrid IDs, showing which Comm channels are used for routing EDI traffic from one trading partner to another.
Endpoint
POST /v2/comms/pair
Request Body
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
ecGridIdFrom | integer | Yes | Must be a valid ECGrid ID | The source ECGrid ID (sender) |
ecGridIdTo | integer | Yes | Must be a valid ECGrid ID | The destination ECGrid ID (receiver) |
{
"ecGridIdFrom": 100001,
"ecGridIdTo": 200002
}
Response
Returns an array of CommIDInfo objects representing the communication path between the two ECGrid IDs.
{
"success": true,
"data": [
{
"commId": 5001,
"mailboxId": 101,
"commType": "as2",
"identifier": "MYCOMPANY-AS2",
"status": "Active",
"useType": "Production",
"privateKeyRequired": true,
"withCerts": true
},
{
"commId": 5099,
"mailboxId": 202,
"commType": "as2",
"identifier": "PARTNER-AS2",
"status": "Active",
"useType": "Production",
"privateKeyRequired": true,
"withCerts": true
}
]
}
Code Examples
- cURL
- C#
- Java
- Node.js
- Python
curl -X POST "https://rest.ecgrid.io/v2/comms/pair" \
-H "X-API-Key: $ECGRID_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "ecGridIdFrom": 100001, "ecGridIdTo": 200002 }'
// .NET 10 — Look up the communication path between two trading partners
var request = new
{
ecGridIdFrom = 100001,
ecGridIdTo = 200002
};
using var response = await httpClient.PostAsJsonAsync(
"https://rest.ecgrid.io/v2/comms/pair",
request);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadFromJsonAsync<ApiResponse<List<CommIdInfo>>>();
Console.WriteLine($"Communication path has {result.Data.Count} channel(s):");
foreach (var comm in result.Data)
{
Console.WriteLine($" Comm {comm.CommId}: {comm.CommType} — {comm.Identifier}");
}
import java.net.URI;
import java.net.http.*;
String apiKey = System.getenv("ECGRID_API_KEY");
String body = "{ \"ecGridIdFrom\": 100001, \"ecGridIdTo\": 200002 }";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://rest.ecgrid.io/v2/comms/pair"))
.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/pair';
const response = await fetch(url, {
method: 'POST',
headers: {
'X-API-Key': apiKey,
'Content-Type': 'application/json',
},
body: JSON.stringify({ "ecGridIdFrom": 100001, "ecGridIdTo": 200002 }),
});
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/pair"
response = requests.post(
url,
json={ "ecGridIdFrom": 100001, "ecGridIdTo": 200002 },
headers=headers,
)
response.raise_for_status()
print(response.json())