Register Third-Party Account
Important Note
This feature is available in the Business plan. If you haven't upgraded yet, please upgrade before using this feature.
API Overview
- Function: This API allows you to create an account for users to access the WeSurvey system via Single Sign-On (SSO).
- Use Case: If your APP or platform (referred to as a third party of WeSurvey) already has a user system, and your users need to use WeSurvey for questionnaire editing, distribution, and answering, this API enables you to track the identities of editors and respondents. After registering users through this API, you can implement seamless integration with WeSurvey using the
Get One-Time Login Code
andSingle Sign-On
APIs for silent login. - Additional Note: This feature also supports respondent integration and can be used with the Data Webhook feature to track respondent identities during and after survey completion.
- Request Method: POST
- Request URL: /api/sso/users?appid={appid}&access_token={access_token}
Request Parameters
Parameter Name | Type | Location | Description | Example |
---|---|---|---|---|
openid | string | body | Third-party user identifier, used to identify users from the third-party application/platform Maximum length: 128 characters The system identifies users by appid+openid combination | c12ba6e8606d11eba20cf64d5fc81bbe |
nickname | string | body | User nickname, maximum length: 64 characters | Zhang San |
avatar | string | body | User avatar URL, maximum length: 255 characters | https://wj.gtimg.com/default/default_headimg.png |
Response Parameters
Parameter Name | Type | Description | Example |
---|---|---|---|
user_id | integer(uint64) | Survey system user ID | 60000208205 |
respondent_id | integer(uint64) | Respondent ID in the survey system, corresponds to the "qq" field in response details | 60000683396 |
Response Example
{
"code": "OK",
"error": {
"type": ""
},
"data": {
"user_id": 60000208205,
"respondent_id": 60000683396
},
"request_id": "d84e884b-3bc5-419d-9cc0-d6d6d14e68b6"
}
Error Codes
error.type Code | Description |
---|---|
user_create_error | Failed to Register User |
openid_existed | User Already Exists, Please Check openid |