Additional Documentation
Establishing a Connection
Authenticating to Facebook
Facebook uses the OAuth standard to authenticate users. OAuth requires the authenticating user to interact with Facebook using the browser.
Posting as a Page
After authenticating to Facebook with your user account, you can post, etc. as one of the pages you manage: Set the AuthenticateAsPage property to the Id of the page you want. You can find the Ids for all pages your account has access to by querying the Pages view.
Automatic Page Authentication
Facebook has made a number of recent changes that require page tokens for most resources owned by a page. This can be troublesome if you manage multiple pages and want to execute the same queries across all pages (such as retrieving Insights). In order to make this work seamlessly with our tools, we have added a way to automatically detect the page token to use. For this to work, simply do not specify the AuthenticateAsPage. Note that the correct page token can only be resolved if the page id is specified as part of the target in the request. This means for some requests you will still need to manually specify AuthenticateAsPage.
Requesting Additional Permissions
You may find while using the provider that Facebook returns an error stating your app does not have permissions to do a certain action. To resolve this, you will need to generate a new OAuth access token with the required permissions. Set the Permissions property in the authentication step for a desktop application.
Web applications need to call the GetOAuthAuthorizationURL and GetOAuthAccessToken stored procedures, which have inputs for the permissions you would like to request.
Note that these are comma-separated lists of permissions, so you can request more than one per authorization request.
You can find a list of available Facebook permissions here: http://developers.facebook.com/docs/authentication/permissions/
Fine-Tuning Data Access
- Target: Some Facebook tables can be filtered by a target. For example, to retrieve comments on a video, specify the Id of the video as the target. This property enables you to restrict the results of all queries in the connection to records that match the specified target. You can also specify this restriction per query with the Target column.
- AggregateFormat: The provider returns some columns as a string aggregate. For example, the available likes data for an entity is returned in aggregate. By default, the provider returns aggregate columns in JSON. You can also return aggregates in XML.
- Version: Set this property to the Facebook API version if you need to work with a different version than the default.
Connection String Options
The connection string properties are the various options that can be used to establish a connection. This section provides a complete list of the options you can configure in the connection string for this provider. Click the links for further details.
For more information on connecting, see Establishing a Connection.Aggregate Format | The format aggregate or collection columns should return in. |
Authenticate As Page | The name or Id of a page to authenticate as when making requests to Facebook. |
Auto Cache | Automatically caches the results of SELECT queries into a cache database specified by either CacheLocation or both of CacheConnection and CacheProvider . |
Cache Connection | The connection string for the cache database. This property is always used in conjunction with CacheProvider . Setting both properties will override the value set for CacheLocation for caching data. |
Cache Location | Specifies the path to the cache when caching to a file. |
Cache Metadata | This property determines whether or not to cache the table metadata to a file store. |
Cache Provider | The name of the provider to be used to cache data. |
Cache Tolerance | The tolerance for stale data in the cache specified in seconds when using AutoCache . |
Callback URL | The OAuth callback URL to return to when authenticating. This value must match the callback URL you specify in your app settings. |
Connection Life Time | The maximum lifetime of a connection in seconds. Once the time has elapsed, the connection object is disposed. |
Firewall Password | A password used to authenticate to a proxy-based firewall. |
Firewall Port | The TCP port for a proxy-based firewall. |
Firewall Server | The name or IP address of a proxy-based firewall. |
Firewall Type | The protocol used by a proxy-based firewall. |
Firewall User | The user name to use to authenticate with a proxy-based firewall. |
Initiate OAuth | Set this property to initiate the process to obtain or refresh the OAuth access token when you connect. |
Location | A path to the directory that contains the schema files defining tables, views, and stored procedures. |
Logfile | A filepath which designates the name and location of the log file. |
Log Modules | Core modules to be included in the log file. |
Max Log File Count | A string specifying the maximum file count of log files. When the limit is hit, a new log is created in the same folder with the date and time appended to the end and the oldest log file will be deleted. |
Max Log File Size | A string specifying the maximum size in bytes for a log file (for example, 10 MB). When the limit is hit, a new log is created in the same folder with the date and time appended to the end. |
Max Rows | Limits the number of rows returned rows when no aggregation or group by is used in the query. This helps avoid performance issues at design time. |
OAuth Access Token | The access token for connecting using OAuth. |
OAuth Client Id | The client ID assigned when you register your application with an OAuth authorization server. |
OAuth Client Secret | The client secret assigned when you register your application with an OAuth authorization server. |
OAuth Expires In | The lifetime in seconds of the OAuth AccessToken. |
OAuth Settings Location | The location of the settings file where OAuth values are saved when InitiateOAuth is set to GETANDREFRESH or REFRESH. Alternatively, this can be held in memory by specifying a value starting with memory://. |
OAuth Token Timestamp | The Unix epoch timestamp in milliseconds when the current Access Token was created. |
OAuth Verifier | The verifier code returned from the OAuth authorization URL. |
Offline | Use offline mode to get the data from the cache instead of the live source. |
Other | These hidden properties are used only in specific use cases. |
Pagesize | The maximum number of results to return per page from Facebook. |
Pool Idle Timeout | The allowed idle time for a connection before it is closed. |
Pool Max Size | The maximum connections in the pool. |
Pool Min Size | The minimum number of connections in the pool. |
Pool Wait Time | The max seconds to wait for an available connection. |
Proxy Auth Scheme | The authentication type to use to authenticate to the ProxyServer proxy. |
Proxy Auto Detect | This indicates whether to use the system proxy settings or not. This takes precedence over other proxy settings, so you'll need to set ProxyAutoDetect to FALSE in order use custom proxy settings. |
Proxy Exceptions | A semicolon separated list of destination hostnames or IPs that are exempt from connecting through the ProxyServer . |
Proxy Password | A password to be used to authenticate to the ProxyServer proxy. |
Proxy Port | The TCP port the ProxyServer proxy is running on. |
Proxy Server | The hostname or IP address of a proxy to route HTTP traffic through. |
Proxy SSL Type | The SSL type to use when connecting to the ProxyServer proxy. |
Proxy User | A user name to be used to authenticate to the ProxyServer proxy. |
Pseudo Columns | This property indicates whether or not to include pseudo columns as columns to the table. |
Readonly | You can use this property to enforce read-only access to Facebook from the provider. |
RTK | The runtime key used for licensing. |
SSL Server Cert | The certificate to be accepted from the server when connecting using TLS/SSL. |
Support Enhanced SQL | This property enhances SQL functionality beyond what can be supported through the API directly, by enabling in-memory client-side processing. |
Tables | This property restricts the tables reported to a subset of the available tables. For example, Tables=TableA,TableB,TableC. |
Target | A default target if none is specified. Used for some tables, such as Comments, where a target may be specified. |
Timeout | The value in seconds until the timeout error is thrown, canceling the operation. |
Upload Linked Media | Upload linked photos or videos before inserting a new Post. |
Use Connection Pooling | This property enables connection pooling. |
Verbosity | The verbosity level that determines the amount of detail included in the log file. |
Version | The Facebook Graph API version to use. |
Views | Restricts the views reported to a subset of the available tables. For example, Views=ViewA,ViewB,ViewC. |