eSIM Exchange Business Integration API Specification v1.2
redeemQRcode
python
1import requests
2import json
3import hashlib
4
5# URL for the request
6url = "https://api.iroamly.shop/openapi/redeemQRcode"
7
8# Provided AuthKey and AuthSecret, remember to replace them with real values
9auth_key = "YOUR_AUTH_KEY_HERE"
10auth_secret = "YOUR_AUTH_SECRET_HERE"
11
12
13# Calculating Certification
14combined = auth_key + auth_secret
15certification = hashlib.sha256(combined.encode()).hexdigest()
16
17# Header parameters for the request
18headers = {
19 "Content-Type": "application/json",
20 "AuthKey": auth_key,
21 "Certification": certification
22}
23
24# Example data for the request body
25data = {
26 "email": "2m827n32d@gmail.com",
27 "codeList": [
28 {
29 "redeemCode": "nDb4TDCn6vMhbQv",
30 },
31 {
32 "redeemCode": "XRdDeSxBVNbvCpU",
33 }
34 ]
35}
36
37# Sending POST request
38response = requests.post(url, headers=headers, data=json.dumps(data))
39
40# Printing the response content
41print(response.text)
42
43# Example of response
44{"code":1,"msg":"success"}
45