Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Need help, unable to import articles via Client #52

Closed
Faiyaz opened this issue Apr 18, 2016 · 5 comments
Closed

Need help, unable to import articles via Client #52

Faiyaz opened this issue Apr 18, 2016 · 5 comments
Assignees

Comments

@Faiyaz
Copy link

Faiyaz commented Apr 18, 2016

I am getting this exception while trying to import articles - The following code is copied straight from the quickstart.md

        // Instantiate an API client
        $client = Client::create($app_id,$secret,$access_token,$page_id,false);

        // Import the article
        try {
            $client->importArticle($instant_article, false);
        } catch (Exception $e) {
            echo 'Could not import the article: '.$e->getMessage();
        }
exception 'Facebook\Exceptions\FacebookAuthenticationException' with message 'Invalid appsecret_proof provided in the API argument' in /var/www/code/collegehumor/vendor/facebook/php-sdk-v4/src/Facebook/Exceptions/FacebookResponseException.php:106
@Faiyaz
Copy link
Author

Faiyaz commented Apr 18, 2016

@simonengelhardt - Can you please look into this.

@simonengelhardt simonengelhardt self-assigned this Apr 21, 2016
@simonengelhardt
Copy link
Contributor

@Faiyaz Sorry to hear that. I just looked into our logs and it seems you have since been able to import articles. Did you manage to resolve the issue?

If not, could you show a little more of the code where you are calling this, so I can look into what may be causing this? Also, if you could please double check the app id and app secret you are passing in? If those look good, please check that the access token is a page access token with the necessary permissions as described in the Instant Articles API docs (you can use the access token debugger for this).

@Faiyaz
Copy link
Author

Faiyaz commented Apr 22, 2016

Thanks for getting back. So I was unable to get this working, as I kept getting that error. So i switched to using RSS for the time being. As for my code, it is exactly the same as the one setup on quickstart.md

$article = InstantArticle::create();
$transformer->transform($article, $someDocument);

// Instantiate an API client
$client = Client::create(
    '{using our app-id}'
    '{using our app secret}',
    '{page access token}',
    '{page id}',
    false // development envirorment?
);

// Import the article
try {
    $client->importArticle($article, $take_live);
} catch (Exception $e) {
    echo 'Could not import the article: '.$e->getMessage();
}

I have gotten the page access token via the graph api page.

@simonengelhardt
Copy link
Contributor

@Faiyaz I just sent you an email to get a little more information from you, so I can look into the cause. In the meantime, I'm glad you got up and running with RSS.

I will comment back here when we have resolved the issue.

@simonengelhardt
Copy link
Contributor

Closing due to inactivity in the email dialogue. @Faiyaz feel free to send me the requested additional info per email and reopen if this issue still reproduces.

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

No branches or pull requests

2 participants