Skip to main content

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 and Single 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 NameTypeLocationDescriptionExample
openidstringbodyThird-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
nicknamestringbodyUser nickname, maximum length: 64 charactersZhang San
avatarstringbodyUser avatar URL, maximum length: 255 charactershttps://wj.gtimg.com/default/default_headimg.png

Response Parameters

Parameter NameTypeDescriptionExample
user_idinteger(uint64)Survey system user ID60000208205
respondent_idinteger(uint64)Respondent ID in the survey system, corresponds to the "qq" field in response details60000683396

Response Example

{
"code": "OK",
"error": {
"type": ""
},
"data": {
"user_id": 60000208205,
"respondent_id": 60000683396
},
"request_id": "d84e884b-3bc5-419d-9cc0-d6d6d14e68b6"
}

Error Codes

error.type CodeDescription
user_create_errorFailed to Register User
openid_existedUser Already Exists, Please Check openid