API - Login and get session token

To begin using the API, log in with your unique API key - from the top menu, navigate to Account > Billing and Subscriptions, then click the 'Get API key' button


Login


import requests

s = requests.Session()

key='your API key'

s.post(
    'https://app.mentionmind.com/api/login.php',
    data={''key':key}
).text


PHP example

<?php
$url = "https://app.mentionmind.com/api/login.php";
$params = array(
'key=%your-api-key%'
); 
$parameters = implode('&', $params);
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch,CURLOPT_POST, $parameter_count);
curl_setopt($ch,CURLOPT_POSTFIELDS, $parameters);
//execute post
$result = curl_exec($ch);
//close connection
curl_close($ch);
print_r($result);
?>


If everything is done correctly, you will receive a JSON response containing an API token for your session 

Please note that this token is tied to your current IP address and will automatically expire one hour after the last request.

{
    "success""Success: API session successfully started!",
    "token""Hvmx1o6NKPeNalPA43KXhCHwnPVWmcno"
}