Redeem QR Code(Python)
Complete Python request for Redeem QR Code, including the AuthKey and Certification headers. Replace the placeholder AuthKey and AuthSecret with the values from your API key page.
Code Reference
Redeem QR Code(Python)
import requests
import json
import hashlib
# URL for the request
url = "https://api.iroamly.shop/openapi/redeemQRcode"
# Provided AuthKey and AuthSecret, remember to replace them with real values
auth_key = "YOUR_AUTH_KEY_HERE"
auth_secret = "YOUR_AUTH_SECRET_HERE"
# Calculating Certification
combined = auth_key + auth_secret
certification = hashlib.sha256(combined.encode()).hexdigest()
# Header parameters for the request
headers = {
"Content-Type": "application/json",
"AuthKey": auth_key,
"Certification": certification
}
# Example data for the request body
data = {
"email": "2m827n32d@gmail.com",
"codeList": [
{
"redeemCode": "nDb4TDCn6vMhbQv",
},
{
"redeemCode": "XRdDeSxBVNbvCpU",
}
]
}
# Sending POST request
response = requests.post(url, headers=headers, data=json.dumps(data))
# Printing the response content
print(response.text)
# Example of response
{"code":1,"msg":"success"}
API Endpoints
Redeem QR Code
(Note: Will be sent to the specified email, the more you redeem, the longer the waiting time)
Request URL:
https://api.iroamly.shop/openapi/redeemQRcodeRequest Method:
POSTRequest Parameters:
ParameterDescriptionType
emailEmailString
codeListCollection of redeem codesObject[]
productList Fields:
FieldDescriptionType
redeemCodeRedeem codeString
{
"email": "2m827n32d@gmail.com",
"codeList": [
{
"redeemCode": "m8hed7h2fed",
},
{
"redeemCode": "cn88beg9edj",
}
]
}{
"code": 1,
"msg": "success",
}Code Reference