Files
onspring-api-sdk-python/script.py
T

28 lines
853 B
Python
Raw Normal View History

2022-04-16 23:16:53 -05:00
from OnspringClient import OnspringClient
from configparser import ConfigParser
2022-04-17 00:31:43 -05:00
from Models import *
2022-04-16 23:16:53 -05:00
cfg = ConfigParser()
cfg.read('config.ini')
key = cfg['prod']['key']
url = cfg['prod']['url']
onspringClient = OnspringClient(url, key)
2022-04-18 16:13:34 -05:00
request = GetRecordsByAppRequest(240, dataFormat=DataFormat.Raw.name)
2022-04-17 00:31:43 -05:00
response = onspringClient.GetRecordsByAppId(request)
2022-04-18 10:39:20 -05:00
print(f'Status Code: {response.statusCode}')
print(f'Page Size: {response.data.pageSize}')
print(f'Page Number: {response.data.pageNumber}')
print(f'Total Pages: {response.data.totalPages}')
print(f'Total Records: {response.data.totalRecords}')
2022-04-16 23:16:53 -05:00
2022-04-18 10:39:20 -05:00
for record in response.data.records:
print(f' AppId: {record.appId}')
print(f' RecordId: {record.recordId}')
2022-04-18 15:07:31 -05:00
for field in record.fields:
2022-04-18 16:13:34 -05:00
print(f' Type: {field.type}, FieldId: {field.fieldId}, Value: {field.getValue()}')