Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not connect to api, check your ID and SECRET #76

Open
reimax opened this issue Nov 23, 2021 · 3 comments
Open

Could not connect to api, check your ID and SECRET #76

reimax opened this issue Nov 23, 2021 · 3 comments

Comments

@reimax
Copy link

reimax commented Nov 23, 2021

use Sendpulse\RestApi\ApiClient;
use Sendpulse\RestApi\Storage\FileStorage;

class test {
    public static function index()
    {
        define('PATH_TO_ATTACH_FILE', __FILE__);
        $SPApiClient = new ApiClient(config::app('sendpulse_api_user_id'), config::app('sendpulse_api_secret'), new FileStorage());
    }
}

i get error: Could not connect to api, check your ID and SECRET
sendpulse_api_user_id and sendpulse_api_secret i get on https://login.sendpulse.com/settings/#api.

@YuriyChmil
Copy link

I have the same problem. It occurs randomly

@vladimirovii
Copy link

vladimirovii commented Jan 26, 2022

Why do getting a token in the constructor?
When configuring via DI, userId and secret are passed, this ensures further work with the object, but it’s not a fact that any method of this object will be called ... and here there is already a call to the API to get a token

Get the token object where it is used, but not in the constructor!

@a-daryn
Copy link

a-daryn commented Jun 28, 2022

Did you find out what was the problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants