Begin Username/Password Import
This import method requires that you collect your user’s username and password for their address book service.
- Your application collects the user’s username and password combination for the contact source requested.
- Your application calls the
/begin_import/import
endpoint, including the username/password plus the contact source requested. - CloudSponge returns a result object indicating the request has been received and specifying an
import_id
for fetching events and contacts later. - (Optional) Your application displays a status update to the user.
Now your application should go to Step 2 while CloudSponge downloads the address book for you.
Definition
POST https://api.cloudsponge.com/begin_import/import[.format]
Request Arguments
Name | Required? | Description |
---|---|---|
domain_key | Yes | Your domain key. |
domain_password | Yes | Your domain password. |
service | Yes | Service code (click here) |
username | Yes | Your user’s username for the contact source. |
password | Yes | Your user’s password for the contact source. |
include | No | By specifying mailing_address here, mailing addresses will be returned in addition to the other contact information. |
user_id | No | Any unique identifier you use to identify a user. |
echo | No | Any customer defined string data to be returned in the response. |
Example Request
curl --user 33664218758c5244136965160db455db012b1411:Tpa01z+vVPE7MxXi \
--request POST \
--data "service=icloud" \
--data "username=foo" \
--data "password=bar" \
--url "https://api.cloudsponge.com/begin_import/import.json"
Response Variables
Name | Description |
---|---|
status | success or failure |
import_id | The identifier for this import, used in subsequent calls to fetch events and contacts. |
user_id | The customer defined string that was passed in as an argument. |
echo | The customer defined string that was passed in as an argument. |
Example Response (JSON)
{
"status": "success",
"import_id": 1126
}
Example Response (XML)
<?xml version="1.0" encoding="UTF-8"?>
<result>
<status>success</status>
<import-id>1126</import-id>
</result>