API Home
Domain Methods
Member Methods
Country Methods
Forum Methods
Signup/Save user as forum member
A forum framework function that saves user to forum database
Method
POST
URL
https://e7lq80c199.execute-api.us-west-2.amazonaws.com/api1?
Making a Request
Available post parameters are:
- request forum-signup
- key domain API key.
- username Username of registered user.
- email Email of registered user.
- password Password of registered user.
- domain Domain for forum website.
- avatar Avatar link.
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-signup','key'=>'xxxxxxxxxxxxxxxxxxxx', 'domain'=>'yourdomain.com','username'=>'johndoe', 'email'=>'[email protected]','password'=>'12345','avatar'=>'johndoe.png');
$result = $this->createApiCall($url, 'POST', $headers, $params);
API Responses
sample json data:
{
"success": true,
"data": {
"status": 1
}
}
API Errors
[ { "success":false } ]
|