{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from memair import Memair\n", "# Use Otto the sandbox user's access token or create your own at https://memair.com/temporary_access_token\n", "access_token = '0000000000000000000000000000000000000000000000000000000000000000'\n", "\n", "user = Memair(access_token)" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'data': {'Create': {'biometrics': [{'value': 80.0,\n", " 'biometric_type': {'name': 'Systolic Pressure'}},\n", " {'value': 120.0, 'biometric_type': {'name': 'Diastolic Pressure'}},\n", " {'value': 80.0, 'biometric_type': {'name': 'Body Weight'}}],\n", " 'locations': [{'lat': 42.0,\n", " 'lon': 42.0,\n", " 'timestamp': '2018-11-28T19:27:04Z'}]}}}" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# a Create can accept up to 100 records per request\n", "response = user.query('''\n", "mutation {\n", " Create(\n", " biometrics: [\n", " {type: systolic_pressure, value: 80},\n", " {type: diastolic_pressure, value: 120},\n", " {type: weight, value: 80}\n", " ]\n", " locations: [\n", " {lat: 42, lon: 42}\n", " ]\n", " )\n", " {\n", " biometrics {\n", " value\n", " biometric_type {\n", " name\n", " }\n", " }\n", " locations {\n", " lat\n", " lon\n", " timestamp\n", " }\n", " }\n", "}\n", "''')\n", "\n", "response" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.0" } }, "nbformat": 4, "nbformat_minor": 2 }