Skip to main content

API client for Live Journey App

Project description


Logo

QAD | Redzone - Process Intellitence API Client

A Client to interact with Process Intelligence API easily
Explore the API docs

Table of Contents
  1. Getting Started
  2. Usage
  3. CLI
  4. Contact

Getting Started

Prerequisites

In order to login the client you will have to authenticate yourself via your API KEY. If you don't have/lost your api key please contact our tech team at api@livejourney.com in order to generate a new one.

Installation

Install and update using pip:

    pip install -U lj-api-client

(back to top)

Usage

The client allows you to build request in a more convinient way thus speed up your integration with the live journey app.

# Init client
from lj_api_client import Client

api_key = '{YOUR API KEY HERE}'
client = Client(api_key)

# Get current user
res = client.users.fetch_list() 

# List workspaces
res = client.workspaces.fetch_list()

# Get specific worksapce
workspace_id = '{WORKSPACE_ID}'
res = client.workspaces.fetch_item(workspace_id)

# List workspace cards
workspace_id = '{WORKSPACE_ID}'
res = client.workspaces.cards(workspace_id).fetch_list()

# Get specific card
workspace_id, card_id = '{WORKSPACE_ID}', '{CARD_ID}'
res = client.workspaces.cards(workspace_id).fetch_item(card_id)

# Create new card
workspace_id = '{WORKSPACE_ID}'
# Card data see our API Docs for in depth specification
card_data = {
    'name': 'my-new-card',
    'unit_name': 'Unit',
    'permission': 'public',
    'key_mapping': {
        'unit_key': '{YOUR UNIT KEY}',
        'date_format': '{YOUR DATE FORMAT}',
        'event_keys':[
            '{YOUR EVENT KEY}',
        ],
        'date_keys':[
            '{YOUR DATE KEY}',
        ],        
    }
}
res = client.workspaces.cards(workspace_id).create_item(card_data)

# Update card
workspace_id, card_id = '{WORKSPACE_ID}', '{CARD_ID}'
card_new_data = {
    'name': 'new-name'
}
res = client.workspaces.cards(workspace_id).update_item(
        card_id,
        card_new_data
    )

# Delete card
workspace_id, card_id = '{WORKSPACE_ID}', '{CARD_ID}'
res = client.workspaces.cards(workspace_id).delete(card_id)

# Get card presigned url
workspace_id, card_id = '{WORKSPACE_ID}', '{CARD_ID}'
params = {'data_type': 'log'}
res = client.workspaces.cards(workspace_id).presigned_url(card_id).fetch_list(params=params)

# Feed card
workspace_id, card_id = '{WORKSPACE_ID}', '{CARD_ID}'
res = client.workspaces.cards(workspace_id).feed(card_id).create_item({})

# Revert Feed card
workspace_id, card_id = '{WORKSPACE_ID}', '{CARD_ID}'
res = client.workspaces.cards(workspace_id).revert_feed(card_id).create_item({'targeted_upsert_number':1, 'hard':True})

The client also validate the requests via its higher level API

res = client.get_user()

res = client.get_workspaces()

workspace_id = '{WORKSPACE_ID}'
res = client.get_workspace(workspace_id)

workspace_id = '{WORKSPACE_ID}'
res = client.get_cards(workspace_id)

workspace_id, card_id = '{WORKSPACE_ID}', '{CARD_ID}'
res = client.get_card(workspace_id, card_id)

workspace_id = '{WORKSPACE_ID}'
card_data = {
    'name': 'my-new-card3',
    'unit_name': 'Unit',
    'permission': 'public',
    'key_mapping': {
        'unit_key': '{YOUR UNIT KEY}',
        'date_format': '{YOUR DATE FORMAT}',
        'event_keys':[
            '{YOUR EVENT KEY}',
        ],
        'date_keys':[
            '{YOUR DATE KEY}',
        ],        
    }
}
res = client.create_card(workspace_id, card_data)

workspace_id, card_id = '{WORKSPACE_ID}', '{CARD_ID}'
res = client.update_card(workspace_id, card_id, card_new_data)

workspace_id, card_id = '{WORKSPACE_ID}', '{CARD_ID}'
res = client.delete_card(workspace_id, card_id)

workspace_id, card_id = '{WORKSPACE_ID}', '{CARD_ID}'
log_file_path, desc_file_path = '{LOG DATA FILE PATH}', '{DESC DATA FILE PATH}'
res = client.upload_data_to_card(
  workspace_id, 
  card_id, 
  log_file_path, 
  desc_file_path=desc_file_path
)

workspace_id, card_id = '{WORKSPACE_ID}', '{CARD_ID}'
res = client.revert_feed(
  workspace_id, 
  card_id, 
  targeted_upsert_number = 1, 
  hard = True
)

For more examples, please refer to the examples directory

(back to top)

CLI

You can also interact with the API directly from the terminal using our CLI. See the interactive doc ljcli --help for more infos.

(back to top)

Contact

api@livejourney.com

(back to top)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lj_api_client-0.2.2.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lj_api_client-0.2.2-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file lj_api_client-0.2.2.tar.gz.

File metadata

  • Download URL: lj_api_client-0.2.2.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.11.15 Linux/6.17.0-1018-azure

File hashes

Hashes for lj_api_client-0.2.2.tar.gz
Algorithm Hash digest
SHA256 829de668b6894977aa4fad406026515017551c165ddf8003eba9048c5d25782a
MD5 30050c723963e1c85d8e6b867be5b6b6
BLAKE2b-256 bb6e11f8d9074d9cbae53d4d90085ca188091ec3a953671c009da123dd105958

See more details on using hashes here.

File details

Details for the file lj_api_client-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: lj_api_client-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.11.15 Linux/6.17.0-1018-azure

File hashes

Hashes for lj_api_client-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 83933169f905c57c04a38159488ec9e334ca1ece0b7455e11fd702fc34bc7aaa
MD5 16a59b85777c81399f0af79c82fa930f
BLAKE2b-256 725d20d896e2c7d9b343dcc2563313fbaacd37b99ae3db0cde1f64083134289c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page