Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicCkPythonChilkat2-PythonRubySQL ServerSwift 2Swift 3,4,5...TclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcelGo

Visual FoxPro Web API Examples

Primary Categories

ABN AMRO
AWS Translate
Activix CRM
Adyen
Amazon DynamoDB
Amazon MWS
Aruba Fatturazione
Azure Maps
Azure Monitor
Azure OAuth2
Azure Storage Accounts
Bitfinex v2 REST
Bluzone
CallRail
CardConnect
ClickBank
Clickatell
Cloudfare
Constant Contact
DocuSign
ETrade
Etsy
Facebook
Frame.io
GeoOp
GetHarvest
Global Payments
Google People
Google Search Console
Hungary NAV Invoicing
IBM Text to Speech
Jira
Lightspeed
MYOB

Magento
MercadoLibre
Microsoft Calendar
Microsoft Group
Microsoft Tasks and Plans
Microsoft Teams
Okta OAuth/OIDC
OneLogin OIDC
OneNote
PayPal
Peoplevox
Populi
QuickBooks
Rabobank
SMSAPI
SOAP finkok.com
Shippo
Shopify
SimpleTexting
Square
Stripe
SugarCRM
Trello
Twilio
Twitter
VoiceBase
Vonage
Walmart
Walmart v3
WhatsApp
WiX
WooCommerce
Xero
Yousign
_Miscellaneous_
eBay
effectconnect

 

 

 

(Visual FoxPro) Get Current User Information

Demonstrates how to retrieve information about the current Facebook user. This is the most basic thing to get working first (after obtaining an access token).

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

LOCAL loOauth2
LOCAL loRest
LOCAL lnBAutoReconnect
LOCAL lnSuccess
LOCAL lcResponseJson

* This example requires the Chilkat API to have been previously unlocked.
* See Global Unlock Sample for sample code.

* This example assumes we previously obtained an access token
loOauth2 = CreateObject('Chilkat_9_5_0.OAuth2')
loOauth2.AccessToken = "FACEBOOK-ACCESS-TOKEN"

loRest = CreateObject('Chilkat_9_5_0.Rest')

* Connect to Facebook and send the following GET request:

* GET /v2.7/me HTTP/1.1
* Host: graph.facebook.com
lnBAutoReconnect = 1
lnSuccess = loRest.Connect("graph.facebook.com",443,1,lnBAutoReconnect)
IF (lnSuccess <> 1) THEN
    ? loRest.LastErrorText
    RELEASE loOauth2
    RELEASE loRest
    CANCEL
ENDIF

* Provide the authentication credentials (i.e. the access key)
loRest.SetAuthOAuth2(loOauth2)

lcResponseJson = loRest.FullRequestNoBody("GET","/v2.7/me")
IF (loRest.LastMethodSuccess <> 1) THEN
    ? loRest.LastErrorText
    RELEASE loOauth2
    RELEASE loRest
    CANCEL
ENDIF

? lcResponseJson

* The responseJson looks like this:
* {"name":"John Doe","id":"10111011320111110"}

RELEASE loOauth2
RELEASE loRest


 

© 2000-2020 Chilkat Software, Inc. All Rights Reserved.