eSIM Exchange Business Integration API Specification v1.2
qrcodeQuery
python
1import requests
2import json
3import hashlib
4
5# URL for the request
6url = "https://api.iroamly.shop/openapi/qrcodeQuery"
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 "redeemCode":"XRdDeSxBVNbvCpU"
27}
28
29# Sending POST request
30response = requests.post(url, headers=headers, data=json.dumps(data))
31
32# Printing the response content
33print(response.text)
34
35# Example of response
36{
37 "code":1,
38 "qrcode":"https:/code.tokyoesim.com/20231220/1703048857317.65625d0a779f4598d55d77bda43ecd80.png",
39 "msg":"success",
40 "redeemCode":"XRdDeSxBVNbvCpU"
41}
42