Parameter Passing Interface (Strict Validation Mode)
最后更新于
这有帮助吗?
最后更新于
这有帮助吗?
The parameter passing interface (strict validation mode) is used to address the situation where third-party developers have their own system login states (such as mini-program login states, Facebook login, etc.), but wish to synchronize these login states to the survey system.
The following situations do not require the integration of non-MSDK login state transmission interfaces:
The survey is embedded into the game, and the survey system by default supports MSDK login state handling. You can enable this feature by selecting [Settings] -> [MSDK Login Verification] on the survey editing page. Currently, only v3 and v5 versions of MSDK login are supported.
It is only necessary to set a limit on the number of questions each user can answer, without collecting the user's UID. Users can choose to log in using WeChat or QQ. This feature can be enabled in the survey editing page by selecting [Settings] -> [WeChat, QQ login verification].
Developers only need to focus on the developer server process, with an emphasis on the generation of signature and login redirect URLs.
Provide the necessary parameters (see API interface for details, empty values do not need to participate in the signature), using the kv data structure;
Add appSecret as a signature key field to the kv data structure;
Sort the keys in ascending ASCII order;
Traverse the sorted kv data structure and concatenate all elements into a string in the pattern of "key1value1key2value2";
Perform an MD5 digest on the concatenated database to obtain the sign signature;
Add sign as a signature field to the kv data structure;
Convert kv data structure into HTTP query request parameters;
Use the query request parameter to call the login status transfer interface.
PHP code
Request URL Example
Please choose the access interface based on the business deployment domain and whether it is domestic or overseas.
Due to the interface upgrade, games using the inapi prefix login interface in [China] should switch to the new login interface in advance to avoid any disruption. The adjustments are as follows:
Non-QQ domain
QQ domain
Pass parameters using GET request method
Parameter
Is it necessary
Whether to participate in encryption
Data Type
Limit length
Explanation
sid
yes
yes
string
32
Survey ID, can be parsed from survey link
uid
yes
yes
string
255
Unique ID of the logged-in user
timestamp
yes
yes
int
10位
Timestamp
redirect
yes
yes
string
URL address
The URL of the page redirected to after a successful login is usually the survey link. [Note] When encrypting the sign, use the original URL; when concatenating it into the embedded delivery link, first encode the URL and assign it to redirect, then concatenate it into the embedded delivery link. The callback and callback_params in the callback need to be injected into the original survey URL first, and then this URL should be assigned to redirect according to step 1.
source
yes
yes
string
2-10 characters in English
User Custom Channel Identifier
sign
yes
no
string
32
Signature, refer to the signature algorithm法
info
no
yes
string
255
Additional login user information, customizable; will not be encrypted if empty
Please do not include semicolons when assigning values to parameters, otherwise the values will be truncated.
Original link
https://in.weisurvey.com/v2/?sid=60cfe98c76051f40495d32c2
https://in.weisurvey.com/v2/?sid=60cfe98c76051f40495d32c2&callback=3&callback_params=testparams
STEP 2 Concatenate kv data structure string
appSecretiamsecretinfoextra_inforedirecthttps://in.weisurvey.com/v2/?sid=60cfe98c76051f40495d32c2&callback=3&callback_params=testparamssid60cfe98c76051f40495d32c2sourcetestsourcetimestamp1624262138uidtest_uid
sign=ade962f5273a404f72aaabf544b14281
https://in.weisurvey.com/v2/api/autologin?sid=60cfe98c76051f40495d32c2&uid=test_uid×tamp=1624262138&source=testsource&info=extra_info&redirect=https%3A%2F%2Fin.weisurvey.com%2Fv2%2F%3Fsid%3D60cfe98c76051f40495d32c2%26callback%3D3%26callback_params%3Dtestparams&sign=ade962f5273a404f72aaabf544b14281
A key needs to be set on the survey settings page, and the key supports customization.