Get Network Contact
Retrieves the contact information associated with a specific contact role for a given network.
Endpoint
POST /v2/networks/get-contact
Request Body
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
networkId | integer | Yes | — | ID of the network to query |
contactType | string | Yes | See NetworkContactType | The role category of the contact to retrieve |
{
"networkId": 1001,
"contactType": "CustomerService"
}
Response
Returns the contact details for the requested contact role on the network.
{
"success": true,
"data": {
"networkId": 1001,
"contactType": "CustomerService",
"name": "Jane Smith",
"email": "support@acme.example.com",
"phone": "312-555-0199"
},
"errorCode": null,
"message": null
}
ENUMs
NetworkContactType
The contactType field uses the NetworkContactType enum. See the full value table in Appendix: ENUMs.
| Value | Description |
|---|---|
Owner | Primary account owner |
Errors | Recipient for error notifications |
Interconnects | Contact for partner interconnect requests |
Notices | General system notices |
Reports | Recipient for scheduled reports |
Accounting | Billing and invoicing contact |
CustomerService | Customer-facing support contact |
Code Examples
- cURL
- C#
- Java
- Node.js
- Python
curl -X POST "https://rest.ecgrid.io/v2/networks/get-contact" \
-H "X-API-Key: $ECGRID_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "networkId": 1001, "contactType": "CustomerService" }'
// .NET 10 — retrieve the accounting contact for a network
var payload = new
{
networkId = 1001,
contactType = "Accounting"
};
var request = new HttpRequestMessage(HttpMethod.Post, "https://rest.ecgrid.io/v2/networks/get-contact")
{
Content = JsonContent.Create(payload)
};
request.Headers.Add("X-API-Key", configuration["ECGrid:ApiKey"]);
var response = await httpClient.SendAsync(request);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadFromJsonAsync<ApiResponse<NetworkContactInfo>>();
Console.WriteLine($"Accounting contact: {result?.Data?.Name} — {result?.Data?.Email}");
import java.net.URI;
import java.net.http.*;
String apiKey = System.getenv("ECGRID_API_KEY");
String body = "{ \"networkId\": 1001, \"contactType\": \"CustomerService\" }";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://rest.ecgrid.io/v2/networks/get-contact"))
.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/networks/get-contact';
const response = await fetch(url, {
method: 'POST',
headers: {
'X-API-Key': apiKey,
'Content-Type': 'application/json',
},
body: JSON.stringify({ "networkId": 1001, "contactType": "CustomerService" }),
});
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/networks/get-contact"
response = requests.post(
url,
json={ "networkId": 1001, "contactType": "CustomerService" },
headers=headers,
)
response.raise_for_status()
print(response.json())