Synaptop’s API allows you to deploy your web application to multiple platforms and take advantage or Synaptop’s unique live collaboration tools. The Developer application is released on October 28th 2011 and we will be adding the update to the Synappstore the week of November 1st so you can start putting your apps in the Synappstore. In the mean time, you can begin writing your apps using the API. Getting started with the Synaptop API is easy:
You can download a sample app by clicking the Download Now button below:
Your launch url is where Synaptop loads your application from. Set this url to your initialization script on your server. Example: http://mysite.com/my-synaptop-app/index.php; http://mysite.com/; http://www.mysite.com/synaptop-app.asp
Your site domain is important, allowing Synaptop to identify applications and ensure that it is communicating with only trusted sites. Every message between your site and Synaptop requires that this domain matches the domain the request is coming from so please ensure that it is accurate. Example: synaptop.com; myapp.com; www.myapp.com;
Displays that approval status of your application. If your application is approved, it will appear in the Synappstore.
A url that points to the icon for your application. It should be at least 64×64 pixels so that it appears correctly on higher-resolution displays. It must be in PNG format. Example: https://www.iconfinder.com/free_icons
If your application is mobile-ready, set the “mobile-ready” field to true. Mobile applications should be formatted for displays on IOS/Android devices and be optimized for a touch interface. A useful tool to help you get started developing mobile interfaces can be found here: http://jquerymobile.com/
Once you have completed the setup for your application, you will need to get your server ready to launch your app. Below is a “Hello World” style example illustrating the basic framework of a Synaptop application. To be able to access the Synaptop API from your application, you must include the Synaptop API script in the HEAD section of your startup page (the example below uses jQuery to call synaptop.loaded() when the document is ready. You can use any other framework to accomplish this.
Once you have called synaptop.loaded() and notified the operating system that your application is loaded, you can begin accessing the native functionality of the Synaptop Operating system. Below are the various function calls you can make on the Synatop system:
Description: Call the loaded function once your application has loaded to register it with the Synaptop Operating System.
Description: Set a callback function to be called when a new subscriber/follower is added to the program.
Description: Set a callback function to be called when a new subscriber/follower stops following the current user.
Description: Use the native prompt to ask the user a question. question The text of the question you would like to ask the user. questionType The button set that you would like to present to the user. The accepted values for this are “yesno” or “okcancel”. Each will provide an answer of true or false respectively. callback The callback function to run when the question is answered by the user.
Description: Closes your app.
Description: Use the native prompt to show the user a message. message The text of the message you would like to show to the user.
Description: Get a count of how many people are subscribed to the current user.
Description: Open a url in the Synapnet browser. url The url you would like to open.
Description: Returns the user-agent details about the client. The object that is returned will contain two properties: userAgent — the user agent string of the client. device — one of “iPod”, “iPhone”, “iPad”, “BlackBerry”, “Android”, “unknown”. If you need more specification than the options provided, you can parse the user agent string.
Description: Execute a YQL statement and get teh results back in the format of your choosing. yqlQuery The query you would like to execute. Example: SELECT * FROM html WHERE url = ‘http://www.cnn.com’ format Provide the format that you want to receive the results of the query in. You can choose “xml” or “json”.
Description: Send a message to all subscribed/following clients. msg A message that you would like to broadcast to all connected clients.
Description: Send a message to all a subset of subscribed/following clients. Each client that subscribes the onSubscriber function. You can use this information to manage the list of subscribers or you can call the getSubscribers function to get a list of client ids that are currently connected. recipients An array of integer ids of the clients to send the message to. The clients must be part of the current subscribers list to send a message to them. msg A message that you would like to broadcast to the selected connected clients.
Description: Provide a callback function to be initiated when a message is sent from another client to the local client. It is up to you to format your outgoing messages that are sent via the broadcast or broadcastRecipients function so that they are readable by the function provided to onMessage.
Description: Get information about the current user. (Returns the name, id and profile image of the user. callback The function to be called when the user is returned.
Description: Returns a list of subscriber ids. callback The function to be called when the file is returned.
Description: Get a the flash version from swfboject. More about the function here: http://code.google.com/p/swfobject/wiki/api callback Callback with the results of getFlashVersion.
Description: Returns a list of the users current friends that are online: callback Callback function to be passed the list of friends
Description: Start a Synaphone call to the specified user. You can only call contacts that are online and you can get a list of online users using the getOnlineFriends function. usersId The id of the user to call
Description: Open the chat window for a specified user. You can only cgat with contacts that are online and you can get a list of online users using the getOnlineFriends function. usersId The id of the user to chat with
Description: Prompts the user to open a file and then returns the file. callback Callback function to be called with the file as a parameter extensions An array of acceptable extensions to open. Provide null for this parameter to allow selection of any type of file
Description: Lets users drag a file from their desktop and drop it into your app. The file gets uploaded to Synaptop’s servers and then your callback function is called. callback Callback function to be called with the file as a parameter extensions An array of acceptable extensions to open. Provide null for this parameter to allow selection of any type of file