TURL_SendAuthorizedRequest (function reference)

By June 1, 2017 March 21st, 2019 Online Help, Troi URL plug-in
Troi URL Plug-in > Functions reference > TURL_SendAuthorizedRequest
Troi URL Plug-in for FileMaker Pro


Sends a request (like posting a tweet), using the 2 credentials obtained during authorization.

SyntaxFunction badge

TURL_SendAuthorizedRequest ( switches ; method ; requestURL; accessToken ;
                             accessTokenSecret ; theRequest )


switchesdetermine the behaviour of the function
methodeither POST or GET
requestURLURL of the web service to where the request must be sent
accessTokenpart 1 of the 2 credentials obtained during authorization
accessTokenSecretpart 2 of the 2 credentials obtained during authorization
theRequestthe request you want to perform


switches must be set to:

-OAuthProtocolthe plug-in is using the OAuth protocol

Returned Result

Data type returned



If successful this function returns the result of the request. If unsuccessful it returns an error code starting with $$ followed by the error code.

Originated in

Troi URL Plug-in 2.6


FileMaker Pro 14 to 17


With this function you can perform the actual work by sending requests to the web service, for example post a tweet on Twitter.
You need to have gotten credentials first with the two authorization functions TURL_GetAuthorizationURL and TURL_SendAuthorizationPIN.

The plug-in currently only supports the OAuth 1.0A Authorization protocol.


# This script will post a tweet on Twitter. 
# Get the text to tweet in a variable:
Set Variable [ $TweetText ; this::TweetText ]
# Set up the other variables:
Set Variable [ $URL ; "http://api.twitter.com/1/statuses/update.json" ]
# Use the credentials stored in two global fields:
Set Variable [ $oauth_token ; this::gOAuth_token ]
Set Variable [ $oauth_token_secret ; this::gOAuth_token_secret ]
# Build the request to tweet (= a status update in the API):
# NOTE: the text of the tweet must be URL Encoded.
Set Variable [ $request ; "status=" & TURL_ToURLEncoded ( "-Unused" ; this::TweetText ) ]
# Now send the tweet to Twitter, using the POST method, and the oauth credentials.
Set Variable [ $Result ; TURL_SendAuthorizedRequest ( "-OAuthProtocol:" ; "POST" ; 
		$URL ; $oauth_token ; $oauth_token_secret ; $request ) ]
Set Field [ this::Received text ; $Result ]

Related functionsFunction badge


Related topics

Troi URL Plug-in online help (overview)

Online Help Page for Troi URL Plug-in for 14 to 17 –> TURL_SendAuthorizedRequest (urlp4416) 2019-0320 17:16:15