Confirmed users
632
edits
Line 98: | Line 98: | ||
* '''importId''': A unique ID passed back to the caller in callbacks. This allows the caller to disambiguate between import operations in the case that there are multiple operations going on at the same time. | * '''importId''': A unique ID passed back to the caller in callbacks. This allows the caller to disambiguate between import operations in the case that there are multiple operations going on at the same time. | ||
* '''serviceParameters''': An object defining the service to import from. This must contain a "service" parameter. Certain services may require additional parameters. | * '''serviceParameters''': An object defining the service to import from. This must contain a "service" parameter. Certain services may require additional parameters. | ||
* '''newContactCallback''': A callback of the form <tt>function(importId, contact, progress, total)<tt>, called whenever a new contact is imported. Note that this contact may already exist in the database (that is, it may already have an entry with a matching "id" field), in which case the new contact should ''replace'' the existing entry. | * '''newContactCallback''': A callback of the form <tt>function(importId, contact, progress, total)</tt>, called whenever a new contact is imported. Note that this contact may already exist in the database (that is, it may already have an entry with a matching "id" field), in which case the new contact should ''replace'' the existing entry. | ||
** ''importId'': The import ID passed in when startImport was called. | ** ''importId'': The import ID passed in when startImport was called. | ||
** ''contact'': The contact in the format described above | ** ''contact'': The contact in the format described above | ||
** ''progress'': The number of contacts that have been imported from this operation | ** ''progress'': The number of contacts that have been imported from this operation | ||
** ''total'': The total number of contacts in this current import operation. Set to '-1' if unknown. | ** ''total'': The total number of contacts in this current import operation. Set to '-1' if unknown. | ||
* '''errorCallback''': A callback of the form <tt>function(importId, error)<tt> | * '''errorCallback''': A callback of the form <tt>function(importId, error)</tt> | ||
** ''importId'': The import ID passed in when startImport was called. | ** ''importId'': The import ID passed in when startImport was called. | ||
** ''error'': An [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error Error] object with information about the failure. | ** ''error'': An [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error Error] object with information about the failure. |