QR 코드 및 단축 링크

이 가이드에서는 WhatsApp Business Management API를 사용하여 QR 코드를 만들고 관리하는 방법을 설명합니다.

고객은 휴대폰에서 QR 코드를 스캔하여 비즈니스와 빠르게 대화를 시작할 수 있습니다. WhatsApp Business Management API를 사용하면 이러한 QR 코드 및 관련 단축 링크를 만들어 액세스할 수 있습니다.

API 대신 비즈니스 관리자를 사용하여 QR 코드를 관리할 수 있다면 WhatsApp QR 코드 관리하기를 참조하세요.

시작하기 전에

다음과 같은 항목이 필요합니다.

QR 코드 만들기

QR 코드를 만들기 위해서는 WhatsApp Business 전화번호 > 메시지 Qrdls 엔드포인트로 POST 요청을 보내세요.

POST 요청 본문에는 prefilled_message 속성을 메시지 텍스트로 설정하고 generate_qr_image 속성을 원하는 이미지 형식(SVG 또는 PNG)로 설정한 개체를 포함하세요.

요청 예시

curl 'https://graph.facebook.com/v19.0/106540352242922/message_qrdls' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer EAAJB...' \
-d '
{
  "prefilled_message": "Cyber Monday",
  "generate_qr_image": "SVG"
}'

응답 예시

{
  "code": "4O4YGZEG3RIVE1",
  "prefilled_message": "Cyber Monday 1",
  "deep_link_url": "https://wa.me/message/4O4YGZEG3RIVE1",
  "qr_image_url": "https://scontent-iad3-2.xx.fbcdn.net/..."
}

QR 코드의 리스트 가져오기

비즈니스 전화번호에 대한 모든 QR 코드의 리스트를 가져오려면 WhatsApp Business 전화번호 > 메시지 Qrdls 엔드포인트로 GET 요청을 보내세요.

요청 예시

curl 'https://graph.facebook.com/v19.0/106540352242922/message_qrdls' \
-H 'Authorization: Bearer EAAJB...'

응답 예시

{
  "data": [
    {
      "code": "4O4YGZEG3RIVE1",
      "prefilled_message": "Cyber Monday",
      "deep_link_url": "https://wa.me/message/4O4YGZEG3RIVE1"
    },
    {
      "code": "WOMVT6TJ2BP7A1",
      "prefilled_message": "Tell me more about your production workshop",
      "deep_link_url": "https://wa.me/message/WOMVT6TJ2BP7A1"
    }
  ]
}

QR 코드 가져오기

특정 QR 코드에 대한 정보를 가져오려면 WhatsApp Business 전화번호 > 메시지 Qrdls 엔드포인트로 GET 요청을 보내고 QR 코드 ID를 경로 매개변수로 첨부하세요.

요청 예시

curl 'https://graph.facebook.com/v19.0/106540352242922/message_qrdls/4O4YGZEG3RIVE1' \
-H 'Authorization: Bearer EAAJB...'

응답 예시

{
  "data": [
    {
      "code": "4O4YGZEG3RIVE1",
      "prefilled_message": "Cyber Monday",
      "deep_link_url": "https://wa.me/message/4O4YGZEG3RIVE1"
    }
  ]
}

QR 코드 업데이트

QR 코드를 업데이트하려면 WhatsApp Business 전화번호 > 메시지 Qrdls 엔드포인트로 POST 요청을 보내세요.

POST 본문에 업데이트하고자 하는 QR 코드의 ID로 설정한 code 속성과 새로운 QR 코드 텍스트로 설정한 prefilled_message 속성을 포함하세요.

요청 예시

curl 'https://graph.facebook.com/v19.0/106540352242922/message_qrdls' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer EAAJB...' \
-d '
{
    "code": "4O4YGZEG3RIVE1",
    "prefilled_message": "Cyber Tuesday"
}'

응답 예시

{
  "code": "4O4YGZEG3RIVE1",
  "prefilled_message": "Cyber Tuesday",
  "deep_link_url": "https://wa.me/message/4O4YGZEG3RIVE1"
}

QR 코드 삭제

QR 코드는 자동으로 만료되지 않습니다. QR 코드를 삭제하려면 WhatsApp Business 전화번호 > 메시지 Qrdls 엔드포인트로 DELETE 요청을 보내고 사용 중단하고자 하는 QR 코드 ID를 경로 매개변수로 첨부하세요.

요청 예시

curl -X DELETE 'https://graph.facebook.com/v19.0/106540352242922/message_qrdls/4O4YGZEG3RIVE1' \
-H 'Authorization: Bearer EAAJB...'

응답 예시

{
  "success": true
}

참고 자료

더 알아보기