Message Boards Message Boards

Set up Facebook API on Mathematica?

GROUPS:

I have googled and already read the Facebook Documentation on Wolfram Website. I followed these steps.

  1. facebook = ServiceConnect["Facebook", "New"] Outcome: My Browser opened up, I gave the required permission. I came back to Mathematica, It gave a message in another window which was this, OAuthSigning`OAuthAuthentication::accfail: Failed to obtain OAuth access token for Facebook. On the main program, I saw ServiceConnected[ (Facebook Connected BUTTON)] SO FAR SO GOOD.

  2. facebook["Cover"] , but it again opens the browser, this time WOLFRAM CONNECTOR automatically says thanks for authorizing, your connection .......'some code'. But Mathematica shows this error, ServiceObject::noauth: The service is not authenticated. Try using ServiceConnect.enter image description here

POSTED BY: Archit Bohra
Answer
3 months ago

Hi Archit,

Are you still experiencing this error? What Mathematica version do you have?

Please note that Facebook is very strict with their API security and require permissions not just to connect but basically for every request.

POSTED BY: Christian Pasquel
Answer
2 months ago

hi Chriatian

Yes, I am still facing this error. I am using Mathematica 11.1 on Ubuntu.

I just observed this: After mathematica leads me to the sign in window on the browser, I get this error in a few seconds.enter image description here

POSTED BY: Archit Bohra
Answer
2 months ago

why didn't you investigate ServiceConnect as it suggested ?

POSTED BY: John Hendrickson
Answer
2 months ago

I did. The first step was serviceconnect, if you look closely.

POSTED BY: Archit Bohra
Answer
2 months ago

Does it work with anyone here?

POSTED BY: Archit Bohra
Answer
2 months ago

This should work. Please check which version of ServiceConnection_Facebook,OAuth,OAuthSIgning paclets are being used. Ideally it should be:

In[1]:= PacletInformation["ServiceConnection_Facebook"]

Out[1]= {"Name" -> "ServiceConnection_Facebook", 
 "Version" -> "11.1.12", "BuildNumber" -> "", "Qualifier" -> "", 
 "WolframVersion" -> "11+", "SystemID" -> All, "Description" -> "", 
 "Category" -> "", "Creator" -> "", "Publisher" -> "", 
 "Support" -> "", "Internal" -> False, 
 "Location" -> 
  "C:\\Users\\damanjits\\AppData\\Roaming\\Mathematica\\Paclets\\\
Repository\\ServiceConnection_Facebook-11.1.12", 
 "Context" -> {"Facebook`", "FacebookLoad`"}, "Enabled" -> True, 
 "Loading" -> Manual}

In[2]:= $Version

Out[2]= "11.1.0 for Microsoft Windows (64-bit) (March 13, 2017)"

In[3]:= facebook = ServiceConnect["Facebook"]

Out[3]= ServiceObject["Facebook", 
 "ID" -> "connection-a561cb52c34c33b0a72908df611cb7d9"]

In[4]:= facebook["Cover"] // Head

Out[4]= Image

In[5]:= PacletInformation["OAuth"]

Out[5]= {"Name" -> "OAuth", "Version" -> "11.1.48", 
 "BuildNumber" -> "", "Qualifier" -> "", "WolframVersion" -> "11.0+", 
 "SystemID" -> All, "Description" -> "", "Category" -> "", 
 "Creator" -> "", "Publisher" -> "", "Support" -> "", 
 "Internal" -> False, 
 "Location" -> 
  "C:\\Users\\damanjits\\AppData\\Roaming\\Mathematica\\Paclets\\\
Repository\\OAuth-11.1.48", "Context" -> {"OAuthLoader`", "OAuth`"}, 
 "Enabled" -> True, "Loading" -> Automatic}

In[6]:= PacletInformation["OAuthSigning"]

Out[6]= {"Name" -> "OAuthSigning", "Version" -> "11.1.0", 
 "BuildNumber" -> "", "Qualifier" -> "", "WolframVersion" -> "10.4+", 
 "SystemID" -> All, "Description" -> "", "Category" -> "", 
 "Creator" -> "", "Publisher" -> "", "Support" -> "", 
 "Internal" -> False, 
 "Location" -> 
  "C:\\Program Files\\Wolfram \
Research\\Mathematica\\11.1\\SystemFiles\\Links\\OAuthSigning", 
 "Context" -> {"OAuthSigning`"}, "Enabled" -> True, 
 "Loading" -> Manual}

You can also try deleting OAuth and ServiceConnection_Facebook directories from FileNameJoin[{$UserBaseDirectory, "Paclets", "Repository"}] and try connecting to Facebook service again.

POSTED BY: Damanjit Singh
Answer
2 months ago

Group Abstract Group Abstract