-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate-alt.py
More file actions
executable file
·46 lines (39 loc) · 1.02 KB
/
create-alt.py
File metadata and controls
executable file
·46 lines (39 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env python
import os
import uuid
import requests
# base url
auvious_url = os.environ['AUVIOUS_URL']
client_id = os.environ['CLIENT_ID']
client_secret = os.environ['CLIENT_SECRET']
application_id = os.environ['APPLICATION_ID']
r = requests.post(
f"{auvious_url}/security/oauth/token",
params={
'grant_type': 'client_credentials',
'client_id': client_id,
'client_secret': client_secret
},
timeout=5
)
access_token = r.json()['access_token']
# print(access_token)
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {access_token}'
}
r = requests.post(
f"{auvious_url}/security/genesys/room",
json={
'applicationId': application_id,
'cdestination': 'standalone',
'customerId': str(uuid.uuid4()),
'interactionId': str(uuid.uuid4()),
'ticketExpirationSeconds': 14400,
'urlBase': auvious_url
},
headers = headers,
timeout=5
)
print(f"Customer url: {r.json()['ticketUrl']}")
print(f"Agent url: {r.json()['agentUrl']}")