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

Can't get account data :( #11

Open
wpexplorer opened this issue Sep 7, 2015 · 3 comments
Open

Can't get account data :( #11

wpexplorer opened this issue Sep 7, 2015 · 3 comments

Comments

@wpexplorer
Copy link

No matter what I do I keep getting the following error:

screen shot 2015-09-06 at 7 25 16 pm

What I really don't understand is when looking at the code why are you going to https://account.envato.com/account/edit to pulling the value of the input fields? Not quite sure I understand why this is how you " confirm" the token...

Here is the access granted to the Token (is this correct):

screen shot 2015-09-06 at 7 36 44 pm

Thanks!

@dtbaker
Copy link
Owner

dtbaker commented Sep 10, 2015

Hey @wpexplorer - thanks for testing out the plugin!

This script hits https://account.envato.com/account/edit using cURL and the special "Envato Account Cookie". This basically logs you into Envato from the PHP script. This is nothing to do with the API.

It pulls out the form fields on this account page to verify the username of the currently "logged in" user.

(we need to do it this way so we can post comments, currently it's not possible to post comments through the API so we have to use this special cookie/curl script)

If you would like to see what is happening you can edit the class.envato-api.php file:

public function get_token_account(){
        $url = 'https://account.envato.com/account/edit';
        $response = $this->get_url($url);

and add some debugging to see what is going on:

public function get_token_account(){
        $url = 'https://account.envato.com/account/edit';
        $response = $this->get_url($url);
        echo "Response from cURL request is: $response ";
        exit;

Cheers.

@wpexplorer
Copy link
Author

Should the Token be created with the main account or the "support" account used to answer comments?

@dtbaker
Copy link
Owner

dtbaker commented Sep 10, 2015 via email

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

2 participants