Wetpaint Injected consists of two components: the
JavaScript client application and a set of
data access APIs. Injecting user-generated content into one of your pages is a very simple process. By following these two easy steps, you can be up and running in minutes.
Step 1. Add User-Generated Content To Your Page
Adding user-generated content to your page is easy: you inject it with a server-side include (SSI). See our
Sample Applications for examples of how to do this on the more common Web platforms. Use the following URL for testing, then see
other options for retrieving content:
http://togo.wetpaint.com/CellService/getCellContent.do?key=507ace0d168024cbcb53a9add0e6fe4e9796012e6b420cfafabac6a4357824ef&ns=sandbox-trial&cell.cellId=sample&cell.displayName=sample&cell.url=http://www.wetpaint.comhttp://wapi.wetpaint.com/CellService/getCellContent.do?key=507ace0d168024cbcb53a9add0e6fe4e9796012e6b420cfafabac6a4357824ef&ns=sandbox-trial&cell.cellId=sample&cell.displayName=sample&cell.url=http://www.wetpaint.com |
Step 2. Add the JavaScript Client Application
The Wetpaint Injected client application offers rich WYSIWYG editing and client-side controls for injected content. It must be loaded somewhere above the first injected content cell -- typically in the <head> of the HTML page. Just include the following snippet:
<script src="http://togo.wetpaint.com/JavaScriptService/getBootstrap.do?key="http://wapi.wetpaint.com/JavaScriptService/getBootstrap.do?key=<your developer key>" type="text/javascript"></script> <script type="text/javascript"> if( window.WPCAPI ) {
WPCAPI.setDeveloperKey("<your developer key>""507ace0d168024cbcb53a9add0e6fe4e9796012e6b420cfafabac6a4357824ef"); WPCAPI.setNamespace("<your namespace>""sandbox-trial"); WPCAPI.setLoginTicket("<your login ticket>"); // only required if user is logged in WPCAPI.processLogin = function() { location.href = "/path/to/login/page"; }
} </script> |
Note: Wetpaint Injected displays a login dialog if a user attempts to perform a privileged action (e.g: edit a content cell), but does not have a
login ticket. When the user clicks the Login button in this dialog,
WPCAPI.processLogin() is executed. You should
override this function to perform the action(s) necessary to login the user (and ultimately provide them with a ticket). Example behavior is shown in the snippet above. For more information about retrieving a login ticket and authenticating a user, see the full
Integration Guide.
Now you have SEO-ready user-generated content on your site and a clickable EasyEdit button. Woohoo!What's Next?
Your first set of API calls were made in our
Quick Start Sandbox. Check out our
API Reference to see what other calls you can make. Ready for your own developer key?
Sign up for one today. Once you receive your own private developer credentials, be sure to cover all the bases and visit our full
Integration Guide.