https://github.com/fasteiner/xurrent-python
A Python Module for interacting with Xurrent
https://github.com/fasteiner/xurrent-python
4me python-module python3 xurrent
Last synced: 5 months ago
JSON representation
A Python Module for interacting with Xurrent
- Host: GitHub
- URL: https://github.com/fasteiner/xurrent-python
- Owner: fasteiner
- License: gpl-3.0
- Created: 2024-12-05T13:14:05.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-01-08T20:22:53.000Z (5 months ago)
- Last Synced: 2025-01-08T20:38:53.250Z (5 months ago)
- Topics: 4me, python-module, python3, xurrent
- Language: Python
- Homepage:
- Size: 103 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
- Contributing: Contributing.md
- License: LICENSE
Awesome Lists containing this project
README
# Xurrent Module
This module is used to interact with the Xurrent API. It provides a set of classes to interact with the API.
## Change Log
[ChangeLog.md](https://github.com/fasteiner/xurrent-python/blob/main/ChangeLog.md)
## Contributing
[Contributing.md](Contributing.md)
## Usage
### Basic Usage
```python
from xurrent.core import XurrentApiHelperapitoken = "********"
baseUrl = "https://api.4me.qa/v1"
account = "account-name"x_api_helper = XurrentApiHelper(baseUrl, apitoken, account)
# change log level (default: INFO)
x_api_helper.set_log_level("DEBUG")# Plain API Call
uri = "/requests?subject=Example Subject"
connection_object.api_call(uri, 'GET')# Convert node ID
helper.decode_api_id('ZmFiaWFuc3RlaW5lci4yNDEyMTAxMDE0MTJANG1lLWRlbW8uY29tL1JlcS83MDU3NTU') # [email protected]/Req/705755
# this can be used to derive the ID from the nodeID```
#### People
```python
from xurrent.people import Personpeople = Person.get_by_id(x_api_helper, )
api_user = Person.get_me(x_api_helper)
# get all people with a specific subject
people = Person.get_people(x_api_helper,queryfilter={
"name": "Werner"
})# enable
people.enable()#disable
people.disable()
#archive
people.archive()
#trash
people.trash()
#restore
people.restore()```
#### Requests
```python
from xurrent.requests import Requestrequest = Request.get_by_id(x_api_helper, )
# get all requests with a specific subject
requests = Request.get_request(x_api_helper,queryfilter={
"subject": "Example Subject"
})# close
request.close("closed")# archive
request.archive()#trash
request.trash()#restore
request.restore()
```
##### Request Notes
```python
from xurrent.requests import Request
request = Request.get_by_id(x_api_helper, )request_note = request.get_by_id(x_api_helper, )
# get all request notes with a specific subject
request_notes = request.get_notes(x_api_helper, predefinedFilter="public")request.add_note("This is a test note")
request.add_note({
"text": "This is a test note",
"internal": True
})```
#### Tasks
```python
from xurrent.tasks import Tasktask = Task.get_by_id(x_api_helper, )
# get all tasks with a specific subject
tasks = Task.get_task(x_api_helper,queryfilter={
"subject": "Example Subject"
})# get workflow of task (use expand: True to get the full workflow object)
workflow = task.get_workflow(expand=True)
# or statically
workflow = Task.get_workflow_by_template_id(x_api_helper, , expand=True)# close
task.close()
#cancel
task.cancel() # only possible before the task is started
#reject
task.reject()
#approve
task.approve()```
#### Teams
```python
from xurrent.teams import Teamteam = Team.get_by_id(x_api_helper, )
# get all teams with a specific subject
teams = Team.get_team(x_api_helper,predifinedFilter="enabled")# enable
team.enable()#disable
team.disable()
#archive
team.archive()
#trash
team.trash()
#restore
team.restore()```
#### Workflows
```python
from xurrent.workflows import Workflow
workflow = Workflow.get_by_id(x_api_helper, )
#close
workflow.close() # completion reason: completed, note: closed
# close with completion reason
workflow.close(completion_reason="withdrawn")
#close with completion reason and note
workflow.close(completion_reason="withdrawn", note="This is a test note")```