Ali Verified ID verification query interfaces

Ali Verified ID verification query interfaces

Buy and Demo address

requesting authentication method python

import urllib, urllib2, sys
import ssl


Host = ' https://idenauthen.market.alicloudapi.com ' 
path = ' / idenAuthentication ' 
Method = ' the POST ' 
AppCode = ' your own AppCode ' 
the querys = '' 
the bodys = {}
url = host + path

the bodys [ ' ID NO ' ] = '' ' 340421190210182345 ' '' 
the bodys [ ' name ' ] = '' ' John Doe ' '' 
post_data = urllib.urlencode (the bodys)
request = urllib2.Request(url, post_data)
request.add_header ( ' the Authorization ' , ' AppCode ' + AppCode)
 // API request, the definition of the corresponding Content- the Type
request.add_header('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8')
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
response = urllib2.urlopen(request, context=ctx)
content = response.read()
if (content):
    print(content)

Modify appcode which will give you after purchase, each account can be purchased ten free

Sample request requesting method provides six

Examples of successful return

{
   " Name " : " Joe Smith " ,
   " ID no " : " 340421190710145412 " ,
   " respMessage " : " ID information matches " ,
   " respCode " : " 0000 " ,
   " Province " : " Anhui Province " ,
   " City " : " Huainan " ,
   "county": "凤台县",
  "birthday": "19071014",
  "sex": "M",
  "age": "111"
}

Examples of failure to return

{
   " Name " : " John Doe " ,
   " ID no " : " 340421190710145412 " ,
   " respMessage " : " identity information does not match " ,
   " respCode " : " 0008 " ,
   " Province " : " Anhui Province " ,
   " City " : " Huainan City " ,
   "county": "凤台县",
  "birthday": "19071014",
  "sex": "M",
  "age": "111"
}

Guess you like

Origin www.cnblogs.com/Strangers/p/11924737.html