I found a good example of HttpSocket and sending JSON.
public function actiontooutbound($idUser, $course, $price){ $HttpSocket = new HttpSocket(); $data = array( "api_key" => "API KEY","user_id" => $idUser,"event" => "other","extra" => array("course" => $course,"price"=> $price ) ); $request = array( 'header' => array('Content-Type' => 'application/json', ), ); $data = json_encode($data); $response = $HttpSocket->post('http://api.outbound.io/api/v1/track';, $data, $request); }