vansteen / laravel-sendinblue

A Laravel 5/6/7 service provider, facade and config file for the SendinBlue's API v3 official PHP library.
MIT License
18 stars 8 forks source link

"Call to undefined method SendinBlue\Client\Api\ListsApi::getAccount()" #3

Closed ZephiroRB closed 4 years ago

ZephiroRB commented 5 years ago

Laravel 5.8

composer.json

"vansteen/laravel-sendinblue": "0.4"

Install provider and aliases in app.php

and copy code in Controller.

use Vansteen\Sendinblue\Facades\Sendinblue;

class GetResponseController extends Controller
{
    public function index()
  {

 $config = Sendinblue::getConfiguration();
 $apiInstance = new \SendinBlue\Client\Api\ListsApi(
        // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
        // This is optional, `GuzzleHttp\Client` will be used as default.
        new \GuzzleHttp\Client(),
        $config
    );

try {
                $result = $apiInstance->getAccount();

            } catch (Exception $e) {
                $result = 'Exception when calling AccountApi->getAccount: ';
            }

}

}

"Call to undefined method SendinBlue\Client\Api\ListsApi::getAccount()"

vansteen commented 4 years ago

Hi Carlos,

According to the SendInBlue documentation, to call getAccount(), you should use the class AccountApi

See https://github.com/sendinblue/APIv3-php-library#documentation-for-api-endpoints

You should write :

$apiInstance = new \SendinBlue\Client\Api\AccountApi( new \GuzzleHttp\Client(), $config );