Quick Start GuideThis is a featured page


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.

Don't have your developer key yet? Get it now!

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://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://wapi.wetpaint.com/JavaScriptService/getBootstrap.do?key=<your developer key>" type="text/javascript"></script>
<script type="text/javascript">
if( window.WPCAPI ) {
WPCAPI.setDeveloperKey("507ace0d168024cbcb53a9add0e6fe4e9796012e6b420cfafabac6a4357824ef");
WPCAPI.setNamespace("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.




No user avatar
wetpaint
Latest page update: made by wetpaint , Dec 15 2009, 4:04 PM EST (about this update About This Update wetpaint Edited by wetpaint

2 words added
2 words deleted

view changes

- complete history)
More Info: links to this page
Started By Thread Subject Replies Last Post
jordanallan1996 Evony 1 Aug 21 2009, 9:47 PM EDT by gillianivy
Thread started: Aug 21 2009, 9:54 AM EDT  Watch
This is a fantasitic game.
0  out of 2 found this valuable. Do you?    
Keyword tags: game opinion
Show Last Reply
Showing 1 of 1 threads for this page

Related Content

  (what's this?Related ContentThanks to keyword tags, links to related pages and threads are added to the bottom of your pages. Up to 15 links are shown, determined by matching tags and by how recently the content was updated; keeping the most current at the top. Share your feedback on Wetpaint Central.)