From f185eca2a7e8607fe06c558af8d90e03f6093661 Mon Sep 17 00:00:00 2001 From: MichaelAChrisco Date: Fri, 25 Oct 2024 10:17:14 -0700 Subject: [PATCH] Basic usage on README --- README.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f4ef6e8..f29b35c 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,22 @@ # accelapy -Access Accela via REST API + + +## How to use: + +You may need to get your payload from Accela for your environment. + +```python +from accelapy.accelapy.client import AccelaClient +from accelapy.accelapy.records_client.types import Response +from accelapy.accelapy.records_client.models import RecordModel +import json +from typing import List +from accelapy.accelapy.payload import Payload + +payload = Payload(payload_str='totally-real-payload') +api_client = AccelaClient(payload=payload) +response: Response = api_client.v4_get_records.sync_detailed(client=api_client.authentication_client, custom_id='E24-00103') +json_load = json.loads(response.content) +record_models : List[RecordModel] = [RecordModel.from_dict(x) for x in json_load['result']] +print(record_models) +``` \ No newline at end of file