Estimate a history backfill
const url = 'https://api.inboxcnx.com/v1/grants/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/backfill-estimate?all=true';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.inboxcnx.com/v1/grants/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/backfill-estimate?all=true' \ --header 'Authorization: Bearer <token>'Counts the mail and the minutes a history backfill of a range would take, so the end user can pick a range before starting one.
Pass exactly one of since, days or all=true, and optionally until (default now) to count a window, e.g. to add up nested ranges without counting twice. messages is the mail in the range that matches the grant’s folders and labels, or the part given as roles and labels (comma-separated), counted id by id. A mail in a folder and a label, or in two labels, counts once for each, so with labels messages is an upper bound. A call counts at most pages pages of 500 (default and maximum 20, 10,000 mails). When it stops early, exact is false, messages is a lower bound, and nextPageToken goes on: pass it as pageToken with the same range and subset and add the counts up. It counts mail the grant already received, so it overestimates a range that overlaps an earlier backfill or live mail. estimatedMinutes assumes the full backfill rate of the mailbox. retentionDays is the grant’s retention: mail of the range older than that is delivered, not stored.
Requires the write:connections scope.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Query Parameters
Section titled “Query Parameters”Responses
Section titled “Responses”The estimate
object
Example
{ "messages": 2410, "exact": true, "estimatedMinutes": 27, "retentionDays": 30}Invalid range. invalid_subset: roles or labels name something outside the grant’s filter, or nothing. invalid_page_token: not a nextPageToken of this estimate
object
object
Example generated
{ "error": { "code": "example", "message": "example" }}The credential lacks the write:connections scope
object
object
Example generated
{ "error": { "code": "example", "message": "example" }}No such grant for the caller’s organization and application
object
object
Example generated
{ "error": { "code": "example", "message": "example" }}grant_not_processed: the grant is revoked, paused or blocked, or its mailbox needs a reconnect
object
object
Example generated
{ "error": { "code": "example", "message": "example" }}The provider did not answer
object
object
Example generated
{ "error": { "code": "example", "message": "example" }}