Home  >  Q&A  >  body text

怎样获取带参二维码里的参数?

各位大神好,我现在用PHP做出了个带参数的二维码,但是我想获取到二维码里面参数的详细信息(action_info),请问这个该怎样来实现呢?谢谢~

LRTRLLRTRL2698 days ago1836

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