alipay.marketing.card.activateform.query
Use this interface to query the user information when the user confirms to apply for a membership card.
Request
Service address
Environment | HTTPS request URL |
Production environment |
Request parameters
Parameter | Description |
Basic parameter | |
app_id String (32) | The unique ID that is assigned by Alipay to identify an app
|
method String (128) | The interface name
|
format String (40) | Only JSON is supported.
|
charset String (10) | The charset with which the request data are encoded. UTF-8, GBK, and GB2312 are supported.
|
sign_type String (10) | The signature algorithm used by the merchant to generate the pre-sign string. RSA and RSA2 are supported. RSA2 is preferred.
|
sign String (344) | The signature value. See Signature for details.
|
timestamp String (19) | The time when the request is sent. The format is yyyy-MM-dd HH:mm:ss.
|
version String (3) | The interface version. The value is fixed as 1.0.
|
biz_content String | Collection of request parameters. The maximum length is not limited. Except for common parameters, all other request parameters must be passed in to this parameter. |
Business parameter | |
biz_type String (64) | The business type for the user information inquiry. The value is
|
template_id String (1024) | The ID that is assigned by Alipay to identify a membership card template. The value is the same as that of
|
request_id String (128) | The request ID that is used for querying the information submitted by the user. When the user confirms to authorize the personal information, the user is redirect to the callback address provided by the merchant and this field is returned.
|
Response
Parameter | Description |
Basic parameter | |
code String | Gateway return code, which indicates whether the request is accepted by Alipay gateway.
|
msg String | Description of the gateway return code
|
sub_code String | Processing result of the request
|
sub_msg String | Description of the processing result of the request
|
sign String | The sign value. See Signature for details.
|
Business parameter | |
infos String (102400) | A JSON array that contains the fields that the user must authorize and the corresponding values. For more information about the fields, see alipay.marketing.card.formtemplate.set. Note: Values of OPEN_FORM_FIELD_CERT_TYPE that are returned by Alipay can be:
|
Error codes
Returned result | Description | Solution |
SYSTEM_ERROR | Alipay system error | Try again later. |
INVALID_PARAMETER | Incorrect parameters | Use correct parameters and try again. |
OPEN_PROFILE_QUERY_FAIL | The query is failed. | Try again later. |
REQUEST_ID_EXPIRE | The request ID has expired. | Use an unexpired request ID and try again. |
REQUEST_ID_INVALID | The request ID is invalid. | Check if request_id and template_id are correct. Use correct request ID and template ID to try again. |
Sample
Request sample
Java
AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do","app_id","your private_key","json","GBK","alipay_public_key","RSA2");
AlipayMarketingCardActivateformQueryRequest request = new AlipayMarketingCardActivateformQueryRequest();
request.setBizContent("{" +
"\"biz_type\":\"MEMBER_CARD\"," +
"\"template_id\":\"2071828288283883\"," +
"\"request_id\":\"2017021929993993992839493394\"" +
"}");
AlipayMarketingCardActivateformQueryResponse response = alipayClient.execute(request,accessToken);
if(response.isSuccess()){
System.out.println("The calling is successful.");
} else {
System.out.println("The calling is failed.");
}
.NET
IAopClient client = new DefaultAopClient("https://openapi.alipay.com/gateway.do", "app_id", "merchant_private_key", "json", "1.0", "RSA2", "alipay_public_key", "GBK", false);
AlipayMarketingCardActivateformQueryRequest request= new AlipayMarketingCardActivateformQueryRequest() ;
request.BizContent="{" +
"\"biz_type\":\"MEMBER_CARD\"," +
"\"template_id\":\"2071828288283883\"," +
"\"request_id\":\"2017021929993993992839493394\"" +
"}";
AlipayMarketingCardActivateformQueryResponse response=client.execute(request,accessToken);
Console.WriteLine(response.Body);
PHP
$aop = new AopClient ();
$aop->gatewayUrl = 'https://openapi.alipay.com/gateway.do';
$aop->appId = 'your app_id';
$aop->rsaPrivateKey = 'Please fill in the developer's private key in a line of string, removing the head, tail, and carriage return';
$aop->alipayrsaPublicKey='Please fill in Alipay public key in a line of string';
$aop->apiVersion = '1.0';
$aop->signType = 'RSA2';
$aop->postCharset='GBK';
$aop->format='json';
$request = new AlipayMarketingCardActivateformQueryRequest ();
$request->setBizContent("{" .
"\"biz_type\":\"MEMBER_CARD\"," .
"\"template_id\":\"2071828288283883\"," .
"\"request_id\":\"2017021929993993992839493394\"" .
"}");
$result = $aop->execute ( $request , $accessToken );
$responseNode = str_replace(".", "_", $request->getApiMethodName()) . "_response";
$resultCode = $result->$responseNode->code;
if(!empty($resultCode)&&$resultCode == 10000){
echo "Success";
} else {
echo "Fail";
}
https://openapi.alipay.com/gateway.do?timestamp=2013-01-01 08:08:08&method=alipay.marketing.card.activateform.query&app_id=4521&sign_type=RSA2&sign=ERITJKEIJKJHKKKKKKKHJEREEEEEEEEEEE&version=1.0&auth_token=20130319e9b8d53d09034da8998caefa756c4006&biz_content=
{
"biz_type":"MEMBER_CARD",
"template_id":"2071828288283883",
"request_id":"2017021929993993992839493394"
}
//To ensure a secure communication, verify whether the sign value in the response sample is provided by Ant Financial.
Response sample
JSON
{
"alipay_marketing_card_activateform_query_response": {
"code": "10000",
"msg": "Success",
"infos": "[{\"OPEN_FORM_FIELD_GENDER\":\"Male\"},{\"OPEN_FORM_FIELD_MOBILE\":\"13888888888\"},{\"OPEN_FORM_FIELD_NAME\":\"Tom\"}]"
},
"sign": "ERITJKEIJKJHKKKKKKKHJEREEEEEEEEEEE"
}
XML
<alipay_marketing_card_activateform_query_response>
<code>10000</code>
<msg>Success</msg> <infos>[{"OPEN_FORM_FIELD_GENDER":"Male"},{"OPEN_FORM_FIELD_MOBILE":"13888888888"},{"OPEN_FORM_FIELD_NAME":"Tom"}]</infos>
</alipay_marketing_card_activateform_query_response>
Exception sample
JSON
{
"alipay_marketing_card_activateform_query_response": {
"code": "20000",
"msg": "Service Currently Unavailable",
"sub_code": "isp.unknow-error",
"sub_msg": "The system is busy."
},
"sign": "ERITJKEIJKJHKKKKKKKHJEREEEEEEEEEEE"
}