-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
executable file
·33 lines (24 loc) · 893 Bytes
/
app.py
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
import requests
import json
from logic import checkData
from updater import deals_updated
from slack import send_slack_message
def lambda_handler(event, context):
send_slack_message("Automation Triggered")
url = 'https://ecbmedia.pipedrive.com/api/v1/deals?api_token=ebec4e865d5ad8750b80f50f742856c7d7e06c09'
r = requests.get(url)
if r.status_code == 200:
print("Deals fetched")
JSON = r.json()
clientData = JSON["data"]
print("Sending clientData for CHECK")
checkData(clientData)
print(f'Automation finished : {deals_updated} deals updated!')
send_slack_message(f"Automation finished : {deals_updated} deals updated!")
return {
"statusCode": 200,
"body": json.dumps({
"message": "Successful",
# "location": ip.text.replace("\n", "")
}),
}