Send Authorization PIN URL (script step reference)

Troi URL Plug-in > Script steps reference > Send Authorization PIN URL
Troi URL Plug-in for FileMaker Pro

Send Authorization PIN URL

This will send the PIN (obtained while granting access) to the web service to complete the authorization.

SyntaxScript step badge

Send Authorization PIN URL [ Select ; Result ; Switches ; Method ;
AccessTokenURL ; PIN ]

Options

Select entire contentsreplaces the entire contents of a field with the result. If not checked the result replaces the currently selected portion of the field
Resultthe raw data returned (or an error code)
Switchesthis determines the behavior of the plug-in
Methodeither POST or GET
AccessTokenURLURL to obtain the final access token (and access token secret) from the web service
PINthe PIN (obtained by the user while granting access)

Switches

switches must be set to:

-OAuthProtocolthe plug-in is using the OAuth protocol

you can also use this switch:

-ReturnDataAfterErrorreturn the error code followed by the data

Returned Result

Data type returned

text

Result

If successful this script step returns several named parameters separated by ampersand. In this result are the two credentials access_token and access_token_secret

Originated in

Troi URL Plug-in 5.0

Compatibility

FileMaker Pro 16

Considerations

This script step provides the second step and completes the authorization.
The plug-in currently only supports the OAuth 1.0A Authorization protocol.

The credentials access_token and access_token_secret need to be stored, to be able to perform requests in the future. Normally you can keep using these two credentials, until the user revokes them (on the web service site). Take care to keep the credentials secret, as they are tied to the userID on the web service.

Example

Set Variable [ $PIN; "123456" ] 
Set Variable [ $Twitter_Access_token_step_URL ; "https://api.twitter.com/oauth/access_token" ] 
#send the PIN to Twitter to complete the authorization:
Send Authorization PIN URL [ Select ;  $Twitter_Result ; "-OAuthProtocol" ; "POST" ;
		$Twitter_Access_token_step_URL ; $PIN ]

if succesfull $Twitter_Result will be like:

oauth_token=123456-1w4FgHt&oauth_token_secret=SN4M6F99GG&user_id=12345&screen_name=troi

See the example on how to parse this into separate fields.

Related functionFunction badge

TURL_SendAuthorizationPIN

Online Help Page for Troi URL Plug-in for 12 to 16 –> Send Authorization PIN URL (urlp7415) 2017-0626 14:21:28