Useful Links

URL

https://api.popularmedia.com/rest

HTTP Method

POST

Parameters

Parameter Description Required
method Must be set to import.contacts Yes
version Version of the API the request was written for (currently only version is = "1.0") Yes
web_service_api_key Client specific web service API key Yes
contact_provider_id Contact provider identifier. Accepted provider ids are
YAHOO, GMAIL, AOL, MSN, and HOTMAIL.
Yes
user_email_address User email address used to access the provider's email service Yes
user_email_password User password used to access the provider's email service Yes
response_encoding The desired response encoding format. Accepted encoding
formats are UTF-8 (default) and UTF-16.
Optional
source Use this optional string value to specify the origination point for the API call. This value will only be used for grouping usage statistics (e.g. a report may show that 15 imports performed on a particular date included the source "InviteFriendsPage"). Must be a string no longer than 20 characters. Optional
api_sig

Every API request must include an api_sig parameter that is used to authenticate
the request. The api_sig parameter must be generated as follows:

  1. Sort API call parameters (excluding api_sig) in alphabetical order based
    on the parameter name. Example: foo=1, bar=2, baz=3 sorts to bar=2, baz=3, foo=1
  2. Concatenate the client specific secret key and parameter name-value pairs.
    Example: SECRETbar2baz3foo1
  3. Calculate the hexadecimal md5 hash of the concatenated string
  4. Append the result of the above calculations to the parameter list.
    Example: api_sig=a626bf097044e8b6f7b9214f049f3cc7

API example

  1. API call: https://api.popularmedia.com/rest/method=import.contacts&web_service_api_key=1
    &version=1.0&contact_provider_id=GMAIL&user_email_address=
    myemail@gmail.com&user_email_password=mypassword
  2. Client secret key: 123456
  3. Concatenated String: 123456contact_provider_idGMAILmethodimport.contactsuser_email_address
    myemail@gmail.comuser_email_passwordmypasswordversion1.0web_service_api_key1
Yes

Sample URL

https://api.popularmedia.com/rest

Sample POST Body

method=import.contacts&web_service_api_key=1&version=1.0&contact_provider_id=GMAIL
&user_email_address=myemail@gmail.com&user_email_password=mypassword&api_sig=36479247287428937429

Sample Good Response

Sample Error Response

Error Codes and Messages

Error Code Error Message
0000 Missing api_sig
0001 Missing method
0002 Missing version
0003 Missing web_service_api_key
0004 Missing contact_provider_id
0005 Missing user_email_address
0006 Missing user_email_password
0101 Invalid method specified
0102 Invalid version specified
0103 Invalid web_service_api_key specified
0104 Invalid contact_provider_id specified
0105 Invalid user_email_address specified
0106 Invalid user_email_password specified
1000 Invalid contact_provider_id / user_email_address combination. The user_email_address is from a domain that does not match the contact_provider_id.
9101 Internal errors during processing
9102 Bad credentials provided. Please verify that the user_email_address and user_email_password are valid and correspond to an active webmail account. Also ensure that none of the parameters have been URL encoded (be aware that some http client software automatically URL encodes parameters).
9990 Request failed authentication. The api_sig parameter does not match the expected value. Please ensure that you have followed all the steps to create the api_sig parameter properly. Also ensure that none of the parameters have been URL encoded (be aware that some http client software automatically URL encodes parameters).
9991 Request failed authorization