Discover how a bimodal integration strategy can address the major data management challenges facing your organization today.
Get the Report →How to connect SharePoint with WooCommerce Data through external lists
Provide WooCommerce data to SharePoint users as an external list.
You can use the CData API Server with the ADO.NET Provider for WooCommerce (or any of 200+ other ADO.NET Providers) to give your users the capabilities to access and update WooCommerce data in SharePoint. This article shows how to create an external list of WooCommerce data that is always up to date. You will use an external content type as a template to create the external list. The external content type enables connectivity through OData, a real-time data streaming protocol for mobile and other online applications. The API Server is an OData producer of WooCommerce feeds.
After setting up the API Server, creating an external list with connectivity to WooCommerce data consists of three basic steps:
This article also covers how to accomplish the following tasks:
Set Up the API Server
Follow the steps below to begin producing secure WooCommerce OData services:
Deploy
The API Server runs on your own server. On Windows, you can deploy using the stand-alone server or IIS. On a Java servlet container, drop in the API Server WAR file. See the help documentation for more information and how-tos.
The API Server is also easy to deploy on Microsoft Azure, Amazon EC2, and Heroku.
Connect to WooCommerce
After you deploy the API Server and the ADO.NET Provider for WooCommerce, provide authentication values and other connection properties needed to connect to WooCommerce by clicking Settings -> Connections and adding a new connection in the API Server administration console.
WooCommerce supports the following authentication methods: one-legged OAuth1.0 Authentication and standard OAuth2.0 Authentication.
Connecting using one-legged OAuth 1.0 Authentication
Specify the following properties (NOTE: the below credentials are generated from WooCommerce settings page and should not be confused with the credentials generated by using WordPress OAuth2.0 plugin):
- ConsumerKey
- ConsumerSecret
Connecting using WordPress OAuth 2.0 Authentication
https://my-server/api.rsc/Orders?$filter=ParentId eq '3'&$sharepoint=AuthMode:Credentials,TargetApplicationId:my-target-application-Id,ODataConnectionSettingsId:my-odata-connection-settings-Id
SharePoint 2013
- Browse to the central administration area for your SharePoint site and click the link to manage service applications.
- Click Secure Store Service and then click New.
- Enter the application Id, display name, and contact email to configure the new secure store target application. Set the target application type to Group.
- On the next page, add the field names and field types to display when the user enters their username and password. Select the username and password field types.
- Next, in the Target Application Administrators section, choose administrators who are authorized to access connection settings for the external content type. In the Members section, enter the users in SharePoint who are authorized to connect with the credentials of the API Server user.
After you create the new secure store target application, follow the procedure below to set the credentials that users in SharePoint will provide when accessing the API Server:
- Click Set Credentials in the menu for the target application.
- In the resulting menu enter the username and password (authtoken) of a user in the API Server.
-
Open an instance of the SharePoint management shell and initialize a new SharePoint connection object. Note that the connection object is site specific.
New-SPODataConnectionSetting -AuthenticationMode Credentials -ServiceAddressURL http://my-server/api.rsc -ServiceContext http://myspsite/ -Name MyODataConnectionSettingsId -SecureStoreTargetApplicationId my-target-application-Id
The output below shows that the command has executed successfully:
The final steps involve creating the external content type for the table you want to expose in SharePoint, configuring it to authenticate with credentials from the secure store, and then importing it into SharePoint.
- Generate the external content type by making a request for data and specifying the required options in the $sharepoint query string parameter:
Below is an example request:
http://my-server/api.rsc/Account?$filter=Industry eq 'Floppy Disks'&$sharepoint=AuthMode:Credentials,TargetApplicationId:my-target-application-Id,ODataConnectionSettingsId:my-odata-connection-settings-Id
- To import the external content type into SharePoint, point your browser to the SharePoint central administration portal and click the link to manage service applications.
- Click Business Data Connectivity Service in the resulting page.
- Click Import and select the .ect file in the dialog.
- You can now create the external list. On the Site Contents page on your SharePoint site, click the button to add an app and then click the icon to choose the external content type.