API Home
Domain Methods
Member Methods
Country Methods
Forum Methods
Update Member Info
A forum framework function that update's user info
Method
POST
URL
https://e7lq80c199.execute-api.us-west-2.amazonaws.com/api1?
Making a Request
Available post parameters are:
- request forum-updatememberinfo
- key domain API key.
- username Member username.
- email Member email.
- avatar Member avatar url.
- member_id Member id.
- domain Domain for forum website.
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-updatememberinfo','key'=>'xxxxxxxxxxxxxxxxxxxx',
'domain'=>'uboard.com','username '=>'johndow', 'email'=>'johndow@mailinator','avatar'=>'http://myavatatar.com/johndow.png','member_id'=>1);
$result = $this->createApiCall($url, 'POST', $headers, $params);
API Responses
sample json data:
{
"success": true,
"data": {
"status": true,
"user": {
"date_joined": "2016-07-11 05:51:25",
"username": "johndow",
"member_id": "10",
"domain": "uboard.com",
"account_type": "free",
"email": "johndow@mailinator",
"is_verified": "1",
"avatar": "http://myavatatar.com/johndow.png",
"email_code": xxxxx"
}
}
}
API Errors
[ { "success":false } ]
|