Skip to content

Commit c71c38d

Browse files
committed
feat: try webhook
1 parent cb340f4 commit c71c38d

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

const.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
LABEL_STUDIO_URL = 'http://localhost:8080'
44
API_KEY = '181439286e4b2ed9c0026f5e46a27a39858e6905'
55
EXPORT_PATH = './export/'
6-
IMPORT_PATH = './img/'
6+
IMPORT_PATH = './import/'
77
PROJ_ID = 1

test.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,21 @@
44
from const import LABEL_STUDIO_URL, API_KEY, EXPORT_PATH, IMPORT_PATH, PROJ_ID
55

66
headers = {
7-
'Authorization': 'Token '+API_KEY,
7+
'Authorization': 'Token ' + API_KEY,
8+
"project": 0,
9+
"url": "",
10+
"send_payload": True,
11+
"send_for_all_actions": True,
12+
"headers": {},
13+
"is_active": True,
14+
"actions": []
815
}
916

1017
proxies = {
1118
'http': 'http://localhost:8080'
1219
}
1320

14-
response = requests.get(
15-
'http://localhost:8080/api/projects/1/tasks/', headers=headers)
16-
print(response.json())
21+
if __name__ == 'main':
22+
response = requests.post(
23+
'http://localhost:8080/api/webhooks', headers=headers)
24+
print(response.json())

0 commit comments

Comments
 (0)