2
$\begingroup$

I am able to send Tweets with:

twitter = ServiceConnect["Twitter", "New"]

Then the command takes me to the API to authorize and then gives me an ID

enter image description here

How can I use a constant ID in the syntax? I try to use

ID = "7AASA3sfsfw-44h-fr67-w45d- asassa787879sas" ... whatever the ID Wolfram gives me (btw the one here is fake).

twitter = ServiceConnect["Twitter", ID]

But it doesn't work. Documentation is not clear about the ID. Any ideas on how a constant ID can be used?

$\endgroup$
1
$\begingroup$

I could not try with Twitter because I don't have an account, so I tried with Dropbox.

I think you should extract the ID from the ServiceObject returned by ServiceConnect. Here is what I tried:

dropbox = ServiceConnect["Dropbox", "New"]

connected

The extract the connection ID from the ServiceObject itself:

dboxID = dropbox["ID"]
(* Out: "connection-f345cd78bda2ad8eb885477ec4b22487" *)

I then tried to close the connection, reopen it using the ID i saved, and checking the ID on this second object returned the same value as before:

ServiceDisconnect[dropbox]

Check that I am disconnected:

dropbox["ID"]

disconnection confirmation

Reconnect with the saved ID:

ServiceConnect["Dropbox", dboxID]

dboxID = dropbox["ID"]

The output returns the same connection ID.

$\endgroup$
  • $\begingroup$ Thanks! adding the connection- part to the ID fixed the issue. $\endgroup$ – fonsi Apr 26 '18 at 4:53
  • $\begingroup$ @fonsi Glad it helped! $\endgroup$ – MarcoB Apr 26 '18 at 5:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.