본문으로 건너뛰기
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/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 엔드포인트

QR 코드로 전환

(참고: 전환 후 QR 코드는 지정한 이메일 주소로 전송됩니다. 수량이 많을수록 처리 시간이 길어질 수 있습니다.)

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

요청 파라미터:

파라미터설명유형
email이메일String
codeList교환 코드 모음Object[]

productList 필드:

필드설명유형
redeemCode교환 코드String
파라미터 예시
{
  "email": "2m827n32d@gmail.com",
  "codeList": [
    {
      "redeemCode": "m8hed7h2fed",
    },
    {
      "redeemCode": "cn88beg9edj",
    }
  ]
}
반환 예시
{
  "code": 1,
  "msg": "success",
}
코드 참조

Python 예시 더 보기