Moxtra Clip Widget for Web

Embed the Moxtra Clip (Note) module into your web application using the simple JavaScript calls mentioned in this document.

Start Clip

Optional parameters to include in Moxtra.clip() API request
Name Value Description
binder_id Binder ID Specify a binder ID if the content(pages) from a binder should be loaded automatically when the clip (note) is started.
page_index Page Index Specify a page index if the content(pages) from a specific page of the binder should be loaded automatically when the clip (note) is started.
iframe "true" or "false" Default is false. Specify to start the clip (note) in iframe or in a new window.
border "true" or "false" Default is true. Specify "false" if using iframe inside a tag without border around the iframe.
scroll "true" or "false" Default is false. Specify "true" if using iframe inside a tag adding scroll bar around the iframe.
tagid4iframe iFrame ID Specify the ID of iframe container - applicable only if iframe in option is set to "true".
iframewidth iFrame Width Width of the clip iFrame - applicable only if iframe in option is set to "true". Default is set to 1024px. If container controls the width, please set to 100%.
iframeheight iFrame Height Height of the clip iFrame - applicable only if iframe in option is set to "true". Default is set to 768px. If container controls the height, please set to 100%.
no_refresh "true" or "false" Default is false. Specify "true" for caller to handle Clip refresh during browser page refresh. During page refresh please set noterefresh_binder_id as shown below.
noterefresh_binder_id The binder_id value of the Clip before page refresh The binder_id is used when no_refresh is "true" to handle Clip refresh during browser page refresh. This binder_id is obtained from start_note event.

Moxtra start clip (note) callback events handled through a listener
Event Description Attributes
start_note Triggered on successful start of clip (note). session_key, session_id, binder_id
error Triggered in the event of an error. error_code, error_message
save_note Triggered when user close and save the clip (note). destination_binder_id, share_url, download_url
cancel_note Triggered when user close and not save the clip (note).

Start Clip using API and some optional parameters:

var options = {
    iframe: true,
    start_note: function(event) {
        alert("session key: " + event.session_key + " session id: " + event.session_id);
    },
    error: function(event) {
        alert("error code: " + event.error_code + " message: " + event.error_message);
    },
    save_note: function(event) {
        alert("Clip saved: share URL " + event.share_url + " download URL " + event.download_url +
          " destination binder " + event.destination_binder_id);
    },
    cancel_note: function(event) {
        alert("Clip cancelled");
    }
};

Moxtra.clip(options);

Upload File to Clip

Using the session id and session key parameters returned on the successful start of Clip you can upload the files to the in-progress session. To implement this your application will POST the file to https://www.moxtra.com (for production) or https://sandbox.moxtra.com (for sandbox) using the following API:

POST /board/upload?type=original&sessionid=SESSION_ID&key=SESSION_KEY&name=FILE_NAME

Header Content-Type: application/octet-stream
File Content Sent as the body