goldfinch / social-media

Facebook/Instagram API (META) integration, Social Feed for Silverstripe
MIT License
2 stars 1 forks source link

Errors reported when running tasks, yet SocialFeed appears to sync #1

Open elkebe opened 4 months ago

elkebe commented 4 months ago

I keep getting the following errors when running tasks:

Running Task Social Media - refresh token Array ( [error] => [status_code] => 200 [data] => 1 )

Running Task Social Media - long-lived token Array ( [error] => 1 [status_code] => 403 [message] => Missing credentials )

Running Task Social Media - sync Array ( [error] => [status_code] => 200 [data] => 1 )

Not sure what is causing these errors, as the feed does appear to sync.

Am running dev environment using DDEV.

goldfinch commented 4 months ago

Hello,

These two are not errors. error item in the printed array (response) is empty and the status code is 200 which means the request was successful

Running Task Social Media - refresh token Array ( [error] => [status_code] => 200 [data] => 1 )

Running Task Social Media - sync Array ( [error] => [status_code] => 200 [data] => 1 )

The third one highlights the error of missing credentials.

Running Task Social Media - long-lived token Array ( [error] => 1 [status_code] => 403 [message] => Missing credentials )

So, when you run Get long-lived token task dev/tasks/SocialMediaToken you need to make sure you specify App Secret and Access Token in the module's settings in the cms (Social Media > Settings > API).

When you run Refresh long-lived tokens task /dev/tasks/SocialMediaRefresh the Long-Lived Access Token should be presented as well due to the fact that in order to refresh long-live token you need to provide the current one.

If you run Get long-lived token task first, it will store the long-lived token in the database automatically, and you should be able to run refresh task after without doing anything, but not in the opposite order.

Hope it helps.

elkebe commented 4 months ago

Thanks that's very helpful! I guess the only thing I can suggest, is that the response shows something a little more meaningful to the CMS user, such as "Instagram posts were successfully downloaded" or something to the extent.

Great module by the way :)