search

Home  >  Q&A  >  body text

How to get the parameters in the QR code with parameters?

Hello everyone, I am using PHP to create a QR code with parameters, but I want to get the detailed information (action_info) of the parameters in the QR code. How can I achieve this? Thank you~

LRTRLLRTRL2780 days ago1884

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-05-09 09:02:22

    The process of generating a QR code with parameters has two steps. First, we need to create a ticket for the QR code, and then use the ticket to the specified URL to exchange for the QR code.

     Every time you create a QR code ticket, you need to provide a parameter (scene_id) set by the developer. The process of creating a QR code ticket for temporary QR codes and permanent QR codes is introduced respectively.

     Creating a QR code ticket

     Every time you create a QR code ticket, you need to provide a parameter (scene_id) set by the developer. The process of creating a QR code ticket for temporary QR codes and permanent QR codes is introduced respectively.

     Temporary QR code request instructions

     http request method: POST
     URL: IP/cgi-bin/qrcode/create?access_token=TOKENPOST data format: json
     POST data example: {"expire_seconds": 1800, "action_name" : "QR_SCENE", "action_info": {"scene": {"scene_id": 123}}}

     Permanent QR code request instructions

     http request method: POST
     URL: IP/cgi-bin/qrcode/create ?access_token=TOKENPOST data format: json
     POST data example: {"action_name": "QR_LIMIT_SCENE", "action_info": {"scene": {"scene_id": 123}}}

     Parameter description

     Parameter description
     expire_seconds The validity time of this QR code is measured in seconds. The maximum number does not exceed 1800.
     action_name QR code type, QR_SCENE is temporary, QR_LIMIT_SCENE is permanent
     action_info QR code details
     scene_id scene value ID, it is a 32-bit non-0 integer for temporary QR code, and the maximum value is 100000 for permanent QR code ( Currently the parameters only support 1--100000)

    reply
    0
  • Cancelreply