reindex

The reindex method regenerates the specified mailbox index file.

Syntax

{
    <credentials object>,
    "user": <mailbox_name>, 
    "folder": <folder to reindex> 
    "id": <job id>
}

Request fields for reindex

The following fields can be used in the reindex method:

Field name

Obligation

Definition/Value

folder

Optional

The folder that you want to reindex. If not specified, all folders belonging to the user will be reindexed.

id

Optional

The job to check status of. If id is present, folder is ignored.

user

Required

The user whose account you want to reindex.

Response fields for reindex

The following fields may be returned in response to the reindex method:

Field name

Obligation

Description/Value

error

Returned if success = false

A text string that explains the error.

error_number

Returned if success = false

A number that represents the error.

success

Always returned

Indicates whether the request was successful or not. Allowed values are true and false.

Examples for reindex

Example 1

This example reindexes the Inbox folder for account [email protected]

Request

{
"credentials": {
"user": "[email protected]", 
"password": "pencil75"
},
"user": "[email protected]", 
"folder": "INBOX"
}

Response

{
"success": true,
"status": "pending",
"id": "07c08a3b763f0c0d497f7bd2e86f5c45", 
"audit": "light04_509173eea"
}

Example 2

This example checks to see if the reindexing job completed and includes four possible responses.

Request

{
"credentials": {
"user": "[email protected]", 
"password": "pencil75"
},
"user": "[email protected]",
"id": "07c08a3b763f0c0d497f7bd2e86f5c45" 
}

Response A
The job still pending.

{
"success": true,
"status": "pending",
"id": "07c08a3b763f0c0d497f7bd2e86f5c45", 
"audit": "light04_509173eea"
}

Response B

The job is processing.

{
"success": true,
"status": "active",
"id": "07c08a3b763f0c0d497f7bd2e86f5c45", 
"audit": "light04_509173eea"
}

Response C

The job has completed.

{
"success": true,
"status": "complete",
"id": "07c08a3b763f0c0d497f7bd2e86f5c45", 
"audit": "light04_509173eea"
}

Response D

The job ended with an error.

{
"success": true,
"status": "error:some error",
"id": "07c08a3b763f0c0d497f7bd2e86f5c45", 
"audit": "light04_509173eea"
}