본문으로 건너뛰기
iRoamly Shop

QR 코드 조회(Python)

QR 코드 조회에 대한 완전한 Python 요청으로, AuthKey 및 Certification 헤더를 포함합니다. 자리 표시자 AuthKey와 AuthSecret을 API 키 페이지의 값으로 바꾸세요.

코드 참조

QR 코드 조회(Python)

python
import requests
import json
import hashlib

# URL for the request
url = "https://api.iroamly.shop/openapi/qrcodeQuery"

# 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 = {
    "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,
 "qrcode":"https:/code.tokyoesim.com/20231220/1703048857317.65625d0a779f4598d55d77bda43ecd80.png",
 "msg":"success",
 "redeemCode":"XRdDeSxBVNbvCpU"
}
API 엔드포인트

QR 코드 조회

요청 URL:https://api.iroamly.shop/openapi/qrcodeQuery
요청 메서드:POST

요청 파라미터:

파라미터설명유형
redeemCode교환 코드String

응답 필드 설명:

필드설명유형
redeemCode교환 코드String
qrcodeQR 코드 이미지 URLString
status교환 코드 상태(교환 코드 상태 정의 참조)Int
qrcode_contentQR 코드 내용(LPA 활성화 문자열, 예: LPA:1$…)String
iscouldrenewaleSIM 갱신 가능 여부: 1 - 갱신 가능 0 - 갱신 불가Int
파라미터 예시
{
  "redeemCode": "m8hed7h2fed",
}
반환 예시
{
  "code": 1,
  "msg": "success",
  "redeemCode": "m8hed7h2fed",
  "qrcode": "https://dsfjigewafe/qrcode.jpg"
}
코드 참조

Python 예시 더 보기