> On 20 Nov. 2016, at 9:15 am, Roger Eller <[email protected]> wrote:
> 
> I have no use at all for FM, but a lcGoogleDrive would be just wonderful.

Cool, with the OAuth2 library + JSON <-> Array web services aren’t that 
complicated. It’s largely just a matter or reading the API docs from there to 
see how to do what you want to do.

Here’s the example from the OAuth2 library which posts a message to slack:

constant kAuthURL = "https://slack.com/oauth/authorize";
constant kTokenURL = "https://slack.com/api/oauth.access";
constant kClientID = "XXXXXXXXX.XXXXXXXX"
constant kClientSecret = "XXXXXXXXXXXXXXXXXXXXX"
constant kScopes = "incoming-webhook"

OAuth2 kAuthURL, kTokenURL, kClientID, kClientSecret, kScopes, 54303
if the result is not empty then
   answer error "Not authorized!" 
else
   local tAuth
   put it into tAuth
   local tMessage
   ask question "What do you want to send?"
   if it is empty then
      exit mouseUp
   end if
   
   put it into tMessage["text"]
   put ArrayToJSON(tMessage) into tMessage
   
   set the httpHeaders to "Content-type: application/json" & \
         return & "Authorization: token " & sAuth["access_token"]
   post tMessage to url tAuth["incoming_webhook"]["url"]
end if
_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to