Skip to content

yamizis/lumapps-sdk

 
 

Repository files navigation

Please be aware the this sdk is still in beta version (0.1) and is undergoing a fast paced evolution that may break changethe behaviour of some helpers

Make sure of the version you are using (Git tags & releases)


Lumapps SDK is a set of tools to manipulate the LumappsAPI This includes a client that support all the routes of the API (located in folder lumapps_api_client) and a set of helper classes to easily manipulate Lumapps elements as Python Objects and classes (folder lumapps_api_helpers)

Quick start

Installation

git clone https://github.com/lumapps/lumapps-sdk.git
cd lumapps-sdk
pip install -e .

Getting started

Lumapps supports multiple ways of authentification. The fastest one to implement is the following:

Get your token by logging to your Lumapps account. Go to https://sites.lumapps.com and authentificate. Once connected, open the javascript console of your browser and run:

var instance = window.location.pathname.split('/');
instance = instance[instance.length-2];
fetch(window.location.origin+"/service/init?customerHost="+window.location.host+"&instanceSlug="+instance+"&slug=").then(data=>{return data.json()}).then(res => {console.log(res.token)})

This will generate your personal Lumapps token that will be active for 60 minutes, and that we will use in the following steps

Authentification

from lumapps_api_client.lib import ApiClient

token = "MY TOKEN"
api = ApiClient(token=token)

Your first API call

Let's display the full name of a registered user in lumapps

user_email = "YOUR EMAIL"
usr = api.get_call("user", "get", email=user_email)
print("Hello {}".format(usr.get("fullName", "")))

Documentation

The SDK documentation is available in the the wiki The folder "examples" also provides some basic examples to manipulate the sdk

Code convention

Docstring in PEP 484 type annotations format adapted to python 2.7 using comments.

Copyright and license

Code and documentation copyright 2018 LumApps. Code released under the MIT license.

How to get help, contribute, or provide feedback

Please refer to our contributing guidelines.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%