<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=338168267432629&amp;ev=PageView&amp;noscript=1">

JQuery Client Library

Interested in connecting your jQuery to your Nebri instance? We would like to provide these two helper libraries to kick start your efforts. jQuery Client (without auth) jquery Client With Auth What you get: api_request api_module: the name of the api module stored on your NebriOS instance view_name: the name …


Notice: This article is maintained for historical purposes. The Bixly Automate/Nebri OS platform that Bixly built, and this article features, is no longer available. Checkout Serverless Providers as an alternative.

Interested in connecting your jQuery to your Nebri instance? We would like to provide these two helper libraries to kick start your efforts.

jQuery Client (without auth)

jquery Client With Auth

What you get:

api_request

  • api_module: the name of the api module stored on your NebriOS instance
  • view_name: the name of the target function contained in the given api module
  • method: the desired HTTP request method
  • payload: an object containing params and values, if no payload is meant to be sent, null should be passed
  • callback: the function to execute after a successful api request. this callback will receive all data included in your view’s response. null should be sent if a callback is not specified.
  • error_callback: the function to execute after an unsuccessful api request. null should be sent if an error callback is not specified.

Example

<script src="js/jquery.nebri.js"></script>
<script src="js/jquery.nebri_auth.js"></script>
<script type="text/javascript">
    var token_client = new $.NebriTokenClient("instance_name", "token");
    token_client.api_request("nebrios_authentication", "token_auth_endpoint", "POST", {'key': 'value'}, function(data){
        console.log(data);
    });
    var basic_client = new $.NebriBasicClient("instance_name", "username", "password");
    basic_client.api_request("nebrios_authentication", "basic_auth_endpoint", "POST", null, function(data){
        console.log(data);
    });
    var oauth_client = new $.NebriOAuthClient("instance_name", "consumer_key", "consumer_secret", "access_token");
    oauth_client.api_request("nebrios_authentication", "oauth_endpoint", "POST", null, function(data){
        console.log(data);
    });
    var oauth_client_no_token = new $.NebriOAuthClient("instance_name", "consumer_key", "consumer_secret");
    oauth_client.api_request("nebrios_authentication", "oauth_endpoint", "POST", null, function(data){
        console.log(data);
    }, function(error){
        console.log(error)
    });
</script>

Now the software you are creating on your server can easily reach out to your Nebri instance to pull/push information. Ajax to your Nebri instance all day!

 

Similar posts

Get notified about the latest in Tech

Be the first to know about new tech from the experts at Bixly!