API get_api_key. Get CleanTalk Access key automatically
 

The API "get_api_key()" returns a JSON-string containing various information required for CleanTalk services. API server: https://api.cleantalk.org.

Call required POST params:

  • method_name - must be 'get_api_key',
  • email - your e-mail
  • website - URL of your site OR array of URLs

Optional POST params:

  • product_name - one of CleanTalk products, one of:
  1. 'anti-spam'  (default value)
  2. 'anti-spam-hosting'
  3. 'cure_malware'
  4. 'database_api'
  5. 'doboard'
  6. 'security'
  7. 'ssl_certificate'
  8. 'uptime_monitoring'

API returns JSON string, the list of fields depends on the time between the first call and the subsequent ones :

{"data":{"auth_key":"your_auth_key","password_hash":"your_long_password_hash","user_token":"your_user_token","service_id":your_service_id}}

{"data":{"auth_key":"your_auth_key","user_token":"your_user_token"}}

{"data":{"account_exists":1}}

For array of URLs

{"data":{"account_exists":1,"auth_key":"auth_key_1","websites":{"URL_1":{"hostname":"hostname_1","auth_key":"auth_key_1"},"URL_2":{"hostname":"hostname_2","auth_key":"auth_key_2"},"URL_3":{"hostname":"hostname_3","auth_key":"auth_key_3"}}}}

Response explanation:

  • auth_key - Access key for your site to use a CleanTalk product
  • password_hash - hash required for your password recovery
  • user_token - token used to log in to your CleanTalk Control Panel
  • service_id - digital ID of your site in the CleanTalk database
  • websites - array of responses for an array of URLs

Examples: 

Using Wget:

wget -O- --post-data='method_name=get_api_key&email=<your.email>&website=<your.website>' https://api.cleantalk.org

 

Was this information helpful?

It would also be interesting

Copied to clipboard