API Home
Domain Methods
Member Methods
Country Methods
Forum Methods
Login User
Call this function to login user to forum website
Method
POST
URL
https://e7lq80c199.execute-api.us-west-2.amazonaws.com/api1?
Making a Request
Available post parameters are:
- request forum-login/li>
- key domain API key.
- username member username.
- password member password.
- domain forum website domain.
Sample Request
private function createApiCall($url, $method, $headers, $data = array(),$user=null,$pass=null)
{
if (($method == 'PUT') || ($method=='DELETE'))
{
$headers[] = 'X-HTTP-Method-Override: '.$method;
}
$handle = curl_init();
curl_setopt($handle, CURLOPT_URL, $url);
curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
if ($user){
curl_setopt($handle, CURLOPT_USERPWD, $user.':'.$pass);
}
switch($method)
{
case 'GET':
break;
case 'POST':
curl_setopt($handle, CURLOPT_POST, true);
curl_setopt($handle, CURLOPT_POSTFIELDS, json_encode($data));
break;
case 'PUT':
curl_setopt($handle, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($handle, CURLOPT_POSTFIELDS, http_build_query($data));
break;
case 'DELETE':
curl_setopt($handle, CURLOPT_CUSTOMREQUEST, 'DELETE');
break;
}
$response = curl_exec($handle);
return $response;
}
$headers = array('Accept: application/json');
$url = 'https://e7lq80c199.execute-api.us-west-2.amazonaws.com/api1';
$params = array('request'=>'forum-login','key'=>'xxxxxxxxxxxxxxxxxxxx', 'username'=>'johndoe', 'password'=>'1234','domain'=>'uboard.com');
$result = $this->createApiCall($url, 'POST', $headers, $params);
API Responses
sample json data:
{
"success": true,
"data": {
"status": true,
"user": {
"date_joined": "",
"username": "",
"member_id": "",
"domain": "",
"account_type": "",
"email": "",
"password": "",
"is_verified": "",
"avatar": "",
"email_code": ""
}
}
}
API Errors
[ { "success":false } ]
|