<?php
							$curl = curl_init();
							// OPTIONS:
							curl_setopt_array($curl, array(
								CURLOPT_URL => baseUrlWa . 'sendVerificationMessage',
								CURLOPT_RETURNTRANSFER => true,
								CURLOPT_ENCODING => '',
								CURLOPT_MAXREDIRS => 10,
								CURLOPT_TIMEOUT => 0,
								CURLOPT_FOLLOWLOCATION => true,
								CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
								CURLOPT_CUSTOMREQUEST => 'POST',
								CURLOPT_POSTFIELDS => array(
                                    'phone_number' => '62895636931520', 
                                    'ttl' => 180, 
                                    'code' => $otpwa, 
                                    'code_lenght' => 6),
								CURLOPT_HTTPHEADER => array(
									'Authorization: Bearer ' . 'AAEPGAAAJuGB_SNJ8UUdS4mdc8YAKdwNfLQhav0m1EGMWg',
                                    'Content/Type: application/json'
								),
								CURLOPT_SSL_VERIFYHOST => 0,
								CURLOPT_SSL_VERIFYPEER => 0,


								CURLOPT_HEADERFUNCTION =>
								function ($curl, $header) use (&$headers) {
									$len = strlen($header);
									$header = explode(':', $header, 2);
									if (count($header) < 2) // ignore invalid headers
										return $len;

									$headers[strtolower(trim($header[0]))][] = trim($header[1]);

									return $len;
								},


							));


							$response = curl_exec($curl);
							$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); // this results 0 every time
							$res = json_decode($response, true);

							if ($response === false || $httpCode != '200') {
								if ($response == !false) {
									if (isset($res['status_code']) || isset($res['error']))
										$response = $res['error'];
									else
										$response = "Maaf, terjadi error get OTP";
								} else
									$response = curl_error($curl);
							}
                            else
                                echo "salah";
                            
							
?>
