Jump to content

ruzak buah

Members
  • Last visited

  • Posts

    1
  • Reputation

    0
  1. $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://xx.xxxxx.xxx/api/create-message', 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( 'appkey' => 'c62c713a-0641-4771-beb3-00e691985403', 'authkey' => 'KcHKC2F3X7CR4ahLgFyiMUGc2BMNU6jNZC4yVlQb8uvnwA9cZG', 'to' => '65878xxxxxxxx', 'template_id' => '4967ada9-9e05-45a3-8967-47b48ebe7bcd', 'variables' => array( '{name}' => 'Jhone', '{address}' => 'replaceable value' ) ), )); $response = curl_exec($curl); curl_close($curl); echo $response; hello, any one has test Template REST API with custom variables and success? i try but always failed, foreach() argument must be of type array|object, string given , can some one help?