'create', 'key' => $secret_key, 'first_name' => 'John', 'last_name' => 'Smith', 'email' => 'john.doe@example.com', ); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $post_url ); curl_setopt( $ch, CURLOPT_POST, 1 ); curl_setopt( $ch, CURLOPT_USERAGENT, 'curl' ); curl_setopt( $ch, CURLOPT_POSTFIELDS, $post_arr ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); $response = curl_exec( $ch ); curl_close( $ch ); $res = json_decode( $response, true ); if ($res !== NULL) { echo "
API response dump below.
------------------------
"; var_dump( $res ); } else { //API returned unexpected result echo "
Error occurred! API returned unexpected result. Check if CURL PHP library is intalled correctly on this server.
"; }