Code Snippet – Translator

<?php $endpoint = 'https://auto.trigidigital.com/webhook-test/tes-webhook-jfb'; $data = array( 'key1' => 'value1', 'key2' => 'value2' ); $options = array( 'http' => array( 'header' => "Content-type: application/json\r\n", 'method' => 'POST', 'content' => json_encode($data), 'verify_peer' => true, 'verify_peer_name' => true ) ); $context = stream_context_create($options); $response = file_get_contents($endpoint, false, $context); if($response === false){ die('Error: Unable to make the request.'); } $response_data = json_decode($response, true); if($response_data === null){ die('Error: Unable to decode the response JSON.'); } // Check if the response status is hasil sudah diterima if($response_data['status'] === 'hasil sudah diterima'){ echo 'Response status: hasil sudah diterima'; } ?>