src/Middleware/ApiAi.php
protected function getResponse(IncomingMessage $message)
    {
        $response = $this->http->post($this->apiUrl, [], [
            'query' => [$message->getText()],
            'sessionId' => md5($message->getConversationIdentifier()),
            'lang' => $this->lang,
        ], [
            'Authorization: Bearer '.$this->token,
            'Content-Type: application/json; charset=utf-8',
        ], true);

        $this->response = json_decode($response->getContent());

        return $this->response;
    }
protected function getResponse(IncomingMessage $message)
    {
        $response = $this->http->post($this->apiUrl, [], [
            'query' => [$message->getText()],
            'sessionId' => md5($message->getConversationIdentifier()),
            'lang' => $this->lang,
        ], [
            'Authorization: Bearer '.$this->token,
            'Content-Type: application/json; charset=utf-8',
        ], true);

        $this->response = json_decode($response->getContent());

        return $this->response;
    }
protected function getResponse ( IncomingMessage $ message ) { $ response = $ this -> http -> post ( $ this -> apiUrl , [ ] , [ 'query' => [ $ message -> getText ( ) ] , 'sessionId' => md5 ( $ message -> getConversationIdentifier ( ) ) , 'lang' => $ this -> lang , ] , [ 'Authorization: Bearer ' . $ this -> token , 'Content-Type: application/json; charset=utf-8' , ] , true ) ; $ this -> response = json_decode ( $ response -> getContent ( ) ) ; return $ this -> response ; }
Perform the API.ai API call and cache it for the message.
@param  \BotMan\BotMan\Messages\Incoming\IncomingMessage $message
@return \stdClass
Perform the API . ai API call and cache it for the message .