Code Monkey home page Code Monkey logo

sessions-api-python-demos's Introduction

Zuko Sessions API Demos

A series of demo scripts, showing how to consume the Zuko Sessions API, using Python.

Setup

You will need the following:

API key

You will need an API key from the Zuko app to be able to run these scripts. This authenticates you with our API and allows us to authorise your access to a given form.

If you don't have an API key, please reach out to your account manager, who will be able to get one setup for you.

Note: This is different to the form UUID.

Store this as an environment variable:

export ZUKO_API_KEY=abc123abc123

Form UUID

You will also need to know the form UUID for a form which you are currently tracking in Zuko.

Note: This is different to the API key.

Python

These scripts assume:

  • Python 3 is installed.
  • The requests library is installed.

Demos

Fetching sessions

This demo script will retrieve all of the sessions for a given form, for a given time range and return a message informing you of how many sessions were retrieved.

Note: Remember to replace the example form UUID with your form UUID.

./fetch_sessions_demo.py --form-uuid 4ef0392b-dd54-42b6-ba68-4ec10f74e3de --start-time 2023-03-01T00:00:00Z --end-time 2023-04-01T00:00:00Z

Fetching total view, starter, completion and abandonment (VSCA) counts

This demo script will retrieve all of the sessions for a given form, for a given time range and return a message informing you of how views, starters, completions and abandons there were for a given form and time range.

This recreates the top-level stats that are shown in the Zuko application for your form.

./fetch_vsca_demo.py --form-uuid 4ef0392b-dd54-42b6-ba68-4ec10f74e3de --start-time 2023-03-01T00:00:00Z --end-time 2023-04-01T00:00:00Z

Handling rate limiting

This demo script shows how you can handle rate limiting when retrieving sessions from the API.

./handle_rate_limit_demo.py --form-uuid 4ef0392b-dd54-42b6-ba68-4ec10f74e3de --start-time 2023-03-01T00:00:00Z --end-time 2023-04-01T00:00:00Z

sessions-api-python-demos's People

Contributors

joenyland avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.