change to secrets
parent
4868faba72
commit
604fffdd2d
|
@ -10,7 +10,7 @@ from libs.utils import utils
|
|||
secrets = utils.get_secrets()
|
||||
|
||||
try:
|
||||
res = requests.get("https://devdash.ex.umbach.dev/api/v1/productpipeline/update",
|
||||
res = requests.get(secrets["admin_dashboard"]["url"] + "/api/v1/productpipeline/update",
|
||||
headers={"X-Api-key": secrets["admin_dashboard"]["x_api_key"]})
|
||||
res.raise_for_status() # Raises a HTTPError if the HTTP request returned an unsuccessful status code
|
||||
except requests.exceptions.HTTPError as http_err:
|
||||
|
|
|
@ -16,6 +16,8 @@ from libs.utils import utils
|
|||
# load data from secrets
|
||||
secrets = utils.get_secrets()
|
||||
|
||||
crm_endpoint_url = secrets['admin_dashboard']['url'] + "/api/v1/crm"
|
||||
|
||||
headers = {
|
||||
"X-Api-Key": secrets["admin_dashboard"]["x_api_key"],
|
||||
"Content-Type": "application/json"
|
||||
|
@ -48,7 +50,7 @@ discountCode = None
|
|||
|
||||
def CreateCrmCustomer():
|
||||
response = requests.post(
|
||||
url=f"{secrets['admin_dashboard']['crm_endpoint_url']}/customer/create",
|
||||
url=f"{crm_endpoint_url}/customer/create",
|
||||
headers=headers,
|
||||
json={
|
||||
"FirstName": customerName,
|
||||
|
@ -83,7 +85,7 @@ def CheckIfCrmCustomerExists():
|
|||
print(f"Checking if customer exists: {customerEmail}")
|
||||
|
||||
response = requests.post(
|
||||
url=f"{secrets['admin_dashboard']['crm_endpoint_url']}/customer",
|
||||
url=f"{crm_endpoint_url}/customer",
|
||||
headers=headers,
|
||||
json={"Email": customerEmail} # Hier json verwenden, um JSON-Daten zu senden
|
||||
)
|
||||
|
@ -163,7 +165,7 @@ def CreateCrmActivityLink(customerId, thirdVoucher):
|
|||
|
||||
def req(type, url):
|
||||
response = requests.post(
|
||||
url=f"{secrets['admin_dashboard']['crm_endpoint_url']}/links",
|
||||
url=f"{crm_endpoint_url}/links",
|
||||
headers=headers,
|
||||
json={
|
||||
"CustomerId": customerId,
|
||||
|
@ -188,7 +190,7 @@ def CreateCrmActivityLink(customerId, thirdVoucher):
|
|||
|
||||
def GetCustomerActivityLinks(customerId, thirdVoucher):
|
||||
response = requests.get(
|
||||
url=f"{secrets['admin_dashboard']['crm_endpoint_url']}/customer/view/{customerId}",
|
||||
url=f"{crm_endpoint_url}/customer/view/{customerId}",
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue