Title: JSON Request
Last modified: August 30, 2016

---

# JSON Request

 *  [goldcore](https://wordpress.org/support/users/goldcore/)
 * (@goldcore)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/json-request/)
 * Hello , i think your plugin is greate , however i am having trouble understanding
   how it works , i need to connect the registration form input data , with this
   json request and then get the response to be registered with the user data as
   well .
 * this is the request
 * $postData = array(“data” => json_encode(array(
    “MasterID” => “test”, “MasterPassword”
   => “test”, “IsDemo” => “true”, “Password” => “$user password “, //this is required“
   FirstName” => “$first_name”, // this is required “LastName” => “$last_name”, //
   this is required “Email” => “$user_email”, “CountryCitizenshipId” => “”, “State”
   => “”, “City” => “”, “Address” => “”, “PhoneCountryCode” => “1”, “PhoneAreaCode”
   => “”, “PhoneNumber” => “Addtional field1”, “Zip” => “”, “IdentityType” => “”,“
   IdentityNumber” => “”, “Comments” => “wp-register integration” )));
 * $parameters = http_build_query($postData, “”, “&”);
    // Setup cURL $ch = curl_init(‘
   [https://xxxxxx/Open_WL_Account_New&#8217](https://xxxxxx/Open_WL_Account_New&#8217););
   curl_setopt_array($ch, array( CURLOPT_POST => TRUE, CURLOPT_RETURNTRANSFER =>
   FALSE, CURLOPT_SSL_VERIFYPEER => FALSE, //throws SOAP error when this is FALSE//
   CURLOPT_CAINFO => “/etc/cacert.pem”, //tried different CAs here, nothing worked
   CURLOPT_POSTFIELDS => $parameters, CURLOPT_RETURNTRANSFER=>1 ));
 * // Send the request
    $response = curl_exec($ch);
 * // Check cURL errors
    if($response === FALSE){ echo ‘curl fail’; die(curl_error(
   $ch)); }
 * $response_xml = simplexml_load_string($response);
    print_r($response_xml); //
   Print raw response
 * Any idea how to put this code?. the response also comes in the following manner
 * {“IsOK”:”TRUE”, “Message”:”Account created successfully”, “AccountUsername”:”
   8506″, “AccountPassword”:”Aa123″} the password is the same as the registration
   form , but the account username comes from the response , any idea how to capture
   it and register it as an additional Field to be viewed on the user profile?.
 * Any help would be appreciated , thank you.
 * [https://wordpress.org/plugins/register-plus-redux/](https://wordpress.org/plugins/register-plus-redux/)

The topic ‘JSON Request’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/register-plus-redux.svg)
 * [Register Plus Redux](https://wordpress.org/plugins/register-plus-redux/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/register-plus-redux/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/register-plus-redux/)
 * [Active Topics](https://wordpress.org/support/plugin/register-plus-redux/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/register-plus-redux/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/register-plus-redux/reviews/)

## Tags

 * [integration](https://wordpress.org/support/topic-tag/integration/)

 * 0 replies
 * 1 participant
 * Last reply from: [goldcore](https://wordpress.org/support/users/goldcore/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/json-request/)
 * Status: not resolved