Find Mailbag Control ID
Search for parcels that match a given mailbag control ID string.
Endpoint
POST /v2/parcels/find-mailbagcontrolid
Request Body
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
mailboxId | int | No | Narrow the search to a specific mailbox | |
mailbagControlId | string | Yes | Non-empty | The mailbag control ID string to search for |
{
"mailboxId": 1001,
"mailbagControlId": "ACME-2026050701"
}
Response
Returns an array of ParcelIDInfo objects whose mailbag control ID matches the search value.
{
"success": true,
"data": [
{
"parcelId": 987654321,
"mailboxId": 1001,
"networkId": 42,
"fileName": "invoice_batch_20260507.edi",
"bytes": 14872,
"status": "InBoxTransferred",
"ecGridIdFrom": 112233,
"ecGridIdTo": 445566,
"created": "2026-05-07T08:00:00Z",
"modified": "2026-05-07T08:10:00Z"
}
]
}
Code Examples
- cURL
- C#
- Java
- Node.js
- Python
curl -X POST "https://rest.ecgrid.io/v2/parcels/find-mailbagcontrolid" \
-H "X-API-Key: $ECGRID_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "mailboxId": 1001, "mailbagControlId": "ACME-2026050701" }'
// .NET 10 — look up parcels by a previously assigned mailbag control ID
using System.Net.Http.Json;
var searchRequest = new
{
mailboxId = 1001,
mailbagControlId = "ACME-2026050701"
};
var response = await http.PostAsJsonAsync(
"https://rest.ecgrid.io/v2/parcels/find-mailbagcontrolid",
searchRequest);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadFromJsonAsync<ApiResponse<List<ParcelIdInfo>>>();
Console.WriteLine($"Found {result!.Data.Count} parcel(s) matching control ID.");
import java.net.URI;
import java.net.http.*;
String apiKey = System.getenv("ECGRID_API_KEY");
String body = "{ \"mailboxId\": 1001, \"mailbagControlId\": \"ACME-2026050701\" }";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://rest.ecgrid.io/v2/parcels/find-mailbagcontrolid"))
.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/parcels/find-mailbagcontrolid';
const response = await fetch(url, {
method: 'POST',
headers: {
'X-API-Key': apiKey,
'Content-Type': 'application/json',
},
body: JSON.stringify({ "mailboxId": 1001, "mailbagControlId": "ACME-2026050701" }),
});
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/parcels/find-mailbagcontrolid"
response = requests.post(
url,
json={ "mailboxId": 1001, "mailbagControlId": "ACME-2026050701" },
headers=headers,
)
response.raise_for_status()
print(response.json())
See Also
- Set Mailbag Control ID — assign a mailbag control ID to a parcel
- Get Parcel — retrieve full parcel details for a matched result
- Inbox List — broad parcel search with date and status filters