Spaces:
Sleeping
Sleeping
fix payload
Browse files
app.py
CHANGED
@@ -53,8 +53,7 @@ import json
|
|
53 |
# Function to request product ID from Tokopedia
|
54 |
def request_product_id(shop_domain, product_key):
|
55 |
ENDPOINT = "https://gql.tokopedia.com/graphql/PDPGetLayoutQuery"
|
56 |
-
payload =
|
57 |
-
{
|
58 |
"operationName": "PDPGetLayoutQuery",
|
59 |
"variables": {
|
60 |
"shopDomain": shop_domain,
|
@@ -62,8 +61,7 @@ def request_product_id(shop_domain, product_key):
|
|
62 |
"layoutID": "",
|
63 |
"apiVersion": 1
|
64 |
}
|
65 |
-
|
66 |
-
])
|
67 |
headers = {
|
68 |
'authority': 'gql.tokopedia.com',
|
69 |
'accept': '*/*',
|
@@ -87,7 +85,7 @@ def request_product_id(shop_domain, product_key):
|
|
87 |
'x-version': '859a718'
|
88 |
}
|
89 |
|
90 |
-
response = requests.post(ENDPOINT, headers=headers,
|
91 |
|
92 |
data = response.json()
|
93 |
|
|
|
53 |
# Function to request product ID from Tokopedia
|
54 |
def request_product_id(shop_domain, product_key):
|
55 |
ENDPOINT = "https://gql.tokopedia.com/graphql/PDPGetLayoutQuery"
|
56 |
+
payload = {
|
|
|
57 |
"operationName": "PDPGetLayoutQuery",
|
58 |
"variables": {
|
59 |
"shopDomain": shop_domain,
|
|
|
61 |
"layoutID": "",
|
62 |
"apiVersion": 1
|
63 |
}
|
64 |
+
}
|
|
|
65 |
headers = {
|
66 |
'authority': 'gql.tokopedia.com',
|
67 |
'accept': '*/*',
|
|
|
85 |
'x-version': '859a718'
|
86 |
}
|
87 |
|
88 |
+
response = requests.post(ENDPOINT, headers=headers, json=payload)
|
89 |
|
90 |
data = response.json()
|
91 |
|