Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Internal error. INTERNALERROR = "InternalError" // Missing parameter. MISSINGPARAMETER = "MissingParameter" // Authentication failed. UNAUTHORIZEDOPERATION_ERRAUTH = "UnauthorizedOperation.ErrAuth" // Operation not authorized/No valid package/The account is overdue UNAUTHORIZEDOPERATION_UNAUTHORIZED = "UnauthorizedOperation.Unauthorized" )
View Source
const APIVersion = "2019-07-22"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
func NewClient ¶
func NewClient(credential common.CredentialIface, region string, clientProfile *profile.ClientProfile) (client *Client, err error)
func NewClientWithSecretId ¶
Deprecated
func (*Client) DescribeCaptchaResult ¶
func (c *Client) DescribeCaptchaResult(request *DescribeCaptchaResultRequest) (response *DescribeCaptchaResultResponse, err error)
DescribeCaptchaResult This API is used to query the result of CAPTCHA ticket verification (web and app).
error code that may be returned:
INTERNALERROR = "InternalError" MISSINGPARAMETER = "MissingParameter" UNAUTHORIZEDOPERATION_ERRAUTH = "UnauthorizedOperation.ErrAuth" UNAUTHORIZEDOPERATION_UNAUTHORIZED = "UnauthorizedOperation.Unauthorized"
func (*Client) DescribeCaptchaResultWithContext ¶
func (c *Client) DescribeCaptchaResultWithContext(ctx context.Context, request *DescribeCaptchaResultRequest) (response *DescribeCaptchaResultResponse, err error)
DescribeCaptchaResult This API is used to query the result of CAPTCHA ticket verification (web and app).
error code that may be returned:
INTERNALERROR = "InternalError" MISSINGPARAMETER = "MissingParameter" UNAUTHORIZEDOPERATION_ERRAUTH = "UnauthorizedOperation.ErrAuth" UNAUTHORIZEDOPERATION_UNAUTHORIZED = "UnauthorizedOperation.Unauthorized"
type DescribeCaptchaResultRequest ¶
type DescribeCaptchaResultRequest struct { *tchttp.BaseRequest // It must be `9` here. You can configure the CAPTCHA types in the console. CaptchaType *uint64 `json:"CaptchaType,omitempty" name:"CaptchaType"` // The user verification ticket returned by the frontend callback function Ticket *string `json:"Ticket,omitempty" name:"Ticket"` // The user public IP obtained from the customer backend server UserIp *string `json:"UserIp,omitempty" name:"UserIp"` // A random string returned by the frontend callback function Randstr *string `json:"Randstr,omitempty" name:"Randstr"` // CAPTCHA's app ID. Log in to the [Captcha console](https://console.cloud.tencent.com/captcha/graphical) and you can view the CaptchaAppId in the "Key" column of the CAPTCHA list. CaptchaAppId *uint64 `json:"CaptchaAppId,omitempty" name:"CaptchaAppId"` // CAPTCHA's app key. Log in to the [Captcha console](https://console.cloud.tencent.com/captcha/graphical) and you can view the AppSecretKey in the "Key" column of the CAPTCHA list. AppSecretKey is the key for CAPTCHA ticket verification performed by the server. Please keep it confidential and do not disclose it to any third parties. AppSecretKey *string `json:"AppSecretKey,omitempty" name:"AppSecretKey"` // Reserved field. BusinessId *uint64 `json:"BusinessId,omitempty" name:"BusinessId"` // Reserved field. SceneId *uint64 `json:"SceneId,omitempty" name:"SceneId"` // MAC address or unique identifier of a device MacAddress *string `json:"MacAddress,omitempty" name:"MacAddress"` // Mobile equipment identity number Imei *string `json:"Imei,omitempty" name:"Imei"` // Indicates whether to return the time when the frontend obtains the CAPTCHA. Valid values: 1 (return the time) and others. NeedGetCaptchaTime *int64 `json:"NeedGetCaptchaTime,omitempty" name:"NeedGetCaptchaTime"` }
func NewDescribeCaptchaResultRequest ¶
func NewDescribeCaptchaResultRequest() (request *DescribeCaptchaResultRequest)
func (*DescribeCaptchaResultRequest) FromJsonString ¶
func (r *DescribeCaptchaResultRequest) FromJsonString(s string) error
FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check
func (*DescribeCaptchaResultRequest) ToJsonString ¶
func (r *DescribeCaptchaResultRequest) ToJsonString() string
type DescribeCaptchaResultRequestParams ¶
type DescribeCaptchaResultRequestParams struct { // It must be `9` here. You can configure the CAPTCHA types in the console. CaptchaType *uint64 `json:"CaptchaType,omitempty" name:"CaptchaType"` // The user verification ticket returned by the frontend callback function Ticket *string `json:"Ticket,omitempty" name:"Ticket"` // The user public IP obtained from the customer backend server UserIp *string `json:"UserIp,omitempty" name:"UserIp"` // A random string returned by the frontend callback function Randstr *string `json:"Randstr,omitempty" name:"Randstr"` // CAPTCHA's app ID. Log in to the [Captcha console](https://console.cloud.tencent.com/captcha/graphical) and you can view the CaptchaAppId in the "Key" column of the CAPTCHA list. CaptchaAppId *uint64 `json:"CaptchaAppId,omitempty" name:"CaptchaAppId"` // CAPTCHA's app key. Log in to the [Captcha console](https://console.cloud.tencent.com/captcha/graphical) and you can view the AppSecretKey in the "Key" column of the CAPTCHA list. AppSecretKey is the key for CAPTCHA ticket verification performed by the server. Please keep it confidential and do not disclose it to any third parties. AppSecretKey *string `json:"AppSecretKey,omitempty" name:"AppSecretKey"` // Reserved field. BusinessId *uint64 `json:"BusinessId,omitempty" name:"BusinessId"` // Reserved field. SceneId *uint64 `json:"SceneId,omitempty" name:"SceneId"` // MAC address or unique identifier of a device MacAddress *string `json:"MacAddress,omitempty" name:"MacAddress"` // Mobile equipment identity number Imei *string `json:"Imei,omitempty" name:"Imei"` // Indicates whether to return the time when the frontend obtains the CAPTCHA. Valid values: 1 (return the time) and others. NeedGetCaptchaTime *int64 `json:"NeedGetCaptchaTime,omitempty" name:"NeedGetCaptchaTime"` }
Predefined struct for user
type DescribeCaptchaResultResponse ¶
type DescribeCaptchaResultResponse struct { *tchttp.BaseResponse Response *DescribeCaptchaResultResponseParams `json:"Response"` }
func NewDescribeCaptchaResultResponse ¶
func NewDescribeCaptchaResultResponse() (response *DescribeCaptchaResultResponse)
func (*DescribeCaptchaResultResponse) FromJsonString ¶
func (r *DescribeCaptchaResultResponse) FromJsonString(s string) error
FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check
func (*DescribeCaptchaResultResponse) ToJsonString ¶
func (r *DescribeCaptchaResultResponse) ToJsonString() string
type DescribeCaptchaResultResponseParams ¶
type DescribeCaptchaResultResponseParams struct { // `1 OK`: Verification passed // `7 captcha no match`: The passed in `Randstr` is invalid. Make sure it is the same as the `Randstr` returned from the frontend. // `8 ticket expired`: The `Ticket` has expired. A ticket is valid for five minutes. Please generate a new `Ticket` and `Randstr`. // `9 ticket reused`: The specified `Ticket` has been used. Please generate a new `Ticket` and `Randstr`. // `15 decrypt fail`: The specified `Ticket` is invalid. Make sure it’s the same as the Ticket returned from the frontend. // `16 appid-ticket mismatch`: The specified `CaptchaAppId` is invalid. Make sure it’s the same as the `CaptchaAppId` returned from the frontend. You can obtain it from the CAPTCHA console in **Verification management** > **Basic configuration**. // `21 diff`. Ticket verification error. Possible reasons: 1) If the ticket contains the `terror` prefix, it’s usually the case that a disaster recovery ticket is generated due to the network connection problems of the user. You can choose to ignore it or verify again. 2) If the ticket does not include the `terror` prefix, Captcha detects security risk on this request . You can choose to block it or not. // `100 appid-secretkey-ticket mismatch`: Parameter error. 1) Make sure `CaptchaAppId` and `AppSecretKey` are correct. `CaptchaAppId` and `AppSecretKey` in the CAPTACHA console under **Verification management** > **Basic configuration**. 2) Make sure the passed-in `Ticket` is generated by using the passed-in `CaptchaAppId`. CaptchaCode *int64 `json:"CaptchaCode,omitempty" name:"CaptchaCode"` // Status description and verification error message // Note: This field may return `null`, indicating that no valid value was found. CaptchaMsg *string `json:"CaptchaMsg,omitempty" name:"CaptchaMsg"` // This parameter returns the result of imperceptible verification. This parameter is not available for Tencent Cloud International yet. // `0`: The request is trusted. // `100`: The request is malicious. // Note: This field may return `null`, indicating that no valid value was found. EvilLevel *int64 `json:"EvilLevel,omitempty" name:"EvilLevel"` // The timestamp when the frontend obtains the CAPTCHA. // Note: This field may return `null`, indicating that no valid value was found. GetCaptchaTime *int64 `json:"GetCaptchaTime,omitempty" name:"GetCaptchaTime"` // Blocking type // Note: This field may return null, indicating that no valid values can be obtained. EvilBitmap *int64 `json:"EvilBitmap,omitempty" name:"EvilBitmap"` // The time when the CAPTCHA is submitted. SubmitCaptchaTime *int64 `json:"SubmitCaptchaTime,omitempty" name:"SubmitCaptchaTime"` // The unique request ID, which is returned for each request. RequestId is required for locating a problem. RequestId *string `json:"RequestId,omitempty" name:"RequestId"` }
Predefined struct for user
Click to show internal directories.
Click to hide internal directories.