/data/check_multi_applications

1.接口描述

该API的功能是通过姓名、身份证号验证该用户是否有在多家借贷平台进行过贷款申请行为。

请求方式

POST

请求 URL

https://cloudapi.linkface.cn/data/check_multi_applications

2.请求参数

字段 类型 必需 描述
api_id string API 账户
api_secret string API 密钥
name string 姓名
id_number string 身份证号码

3.返回参数

字段 类型 描述
request_id string 本次请求的id
status string 返回状态,正常为 OK,其他值表示失败。详见错误码
result object 检查结果,包含:是否多头申请,30天内申请次数,90天内申请次数,1年内申请次数,全部申请次数;详见下表

result 字段说明:

字段 类型 描述
total integer 合计多头申请数
in_1_year integer 近1年多头身申请数
in_90_days integer 近90天多头申请数
in_30_days integer 近30天多头申请数
multi integer 是否多头申请:1 为是,0为未知;发现任何一次申请记录,即为是。

示例:

{
  "request_id": "TID569f78ad4b754479b222380e275de685",
  "status": "OK",
  "result": {
    "total": 1,
    "in_1_year": 1,
    "in_90_days": 0,
    "in_30_days": 0,
    "multi": 1
  }
}

4.错误码

状态码 status 字段 说明
400 ENCODING_ERROR 参数非UTF-8编码
400 INVALID_ARGUMENT 请求参数错误,具体原因见 reason 字段内容
401 UNAUTHORIZED 账号或密钥错误
401 KEY_EXPIRED 账号过期,具体原因见 reason 字段内容
403 RATE_LIMIT_EXCEEDED 调用频率过高
403 OUT_OF_QUOTA 调用次数超出限额
403 NO_PERMISSION 无调用权限
404 NOT_FOUND 请求路径错误
500 DATA_SERVER_ERROR 数据服务异常
500 INTERNAL_ERROR 内部服务异常

说明:

1. 账号问题、路径问题、服务器错误的错误码为 401、403、404、500

返回示例:

{
  "status": "UNAUTHORIZED",
  "request_id": "TID587b589463b24c8389f6884171fc49b4"
}

2. 参数问题的错误码为 400

返回示例:

{
  "status": "INVALID_ARGUMENT",
  "reason": "Invalid id_number",
  "request_id": "TID13cee25b0022443b88dc6d488246e009"
}

5.输入示例

  • cURL 样例
curl -X "POST" "https://cloudapi.linkface.cn/data/check_multi_applications" \
     -H 'Content-Type: application/json; charset=utf-8' \
     -d $'{
  "api_secret": "API_SECRET",
  "id_number": "110xxxxxxxxxxxxxxx",
  "api_id": "API_ID",
  "name": "NAME"
}'
  • ruby 样例
require 'net/http'
require 'net/https'
require 'json'

def send_request
  uri = URI('https://cloudapi.linkface.cn/data/check_multi_applications')

  # Create client
  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = true
  http.verify_mode = OpenSSL::SSL::VERIFY_PEER
  dict = {
            "api_secret" => "API_SECRET",
            "id_number" => "110xxxxxxxxxxxxxxx",
            "api_id" => "API_ID",
            "name" => "NAME"
        }
  body = JSON.dump(dict)

  # Create Request
  req =  Net::HTTP::Post.new(uri)
  # Add headers
  req.add_field "Content-Type", "application/json; charset=utf-8"
  # Set body
  req.body = body

  # Fetch Request
  res = http.request(req)
  puts "Response HTTP Status Code: #{res.code}"
  puts "Response HTTP Response Body: #{res.body}"
rescue StandardError => e
  puts "HTTP Request failed (#{e.message})"
end
  • Python 样例
# Install the Python Requests library:
# `pip install requests`

import requests
import json


def send_request():
    # data/check_multi_applications
    # POST https://cloudapi.linkface.cn/data/check_multi_applications

    try:
        response = requests.post(
            url="https://cloudapi.linkface.cn/data/check_multi_applications",
            headers={
                "Content-Type": "application/json; charset=utf-8",
            },
            data=json.dumps({
                "api_secret": "API_SECRET",
                "id_number": "110xxxxxxxxxxxxxxx",
                "api_id": "API_ID",
                "name": "NAME"
            })
        )
        print('Response HTTP Status Code: {status_code}'.format(
            status_code=response.status_code))
        print('Response HTTP Response Body: {content}'.format(
            content=response.content))
    except requests.exceptions.RequestException:
        print('HTTP Request failed')
  • Golang 样例
package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
    "bytes"
)

func main() {
    sendDataCheckMultiApplications()
}

func sendDataCheckMultiApplications() {
    json := []byte(`{"api_secret": "API_SECRET","id_number": "110xxxxxxxxxxxxxxx","api_id": "API_ID","name": "NAME"}`)
    body := bytes.NewBuffer(json)

    // Create client
    client := &http.Client{}

    // Create request
    req, err := http.NewRequest("POST", "https://cloudapi.linkface.cn/data/check_multi_applications", body)

    // Headers
    req.Header.Add("Content-Type", "application/json; charset=utf-8")

    // Fetch Request
    resp, err := client.Do(req)

    if err != nil {
        fmt.Println("Failure : ", err)
    }

    // Read Response Body
    respBody, _ := ioutil.ReadAll(resp.Body)

    // Display Results
    fmt.Println("response Status : ", resp.Status)
    fmt.Println("response Headers : ", resp.Header)
    fmt.Println("response Body : ", string(respBody))
}
  • java 样例
import java.io.IOException;
import org.apache.http.client.fluent.*;
import org.apache.http.entity.ContentType;

public class SendRequest
{
  public static void main(String[] args) {
    sendRequest();
  }

  private static void sendRequest() {
    try {

      // Create request
      Content content = Request.Post("https://cloudapi.linkface.cn/data/check_multi_applications")

      // Add headers
      .addHeader("Content-Type", "application/json; charset=utf-8")

      // Add body
      .bodyString("{\"api_secret\": \"API_SECRET\",\"id_number\": \"110xxxxxxxxxxxxxxx\",\"api_id\": \"API_ID\",\"name\": \"NAME\"}", ContentType.APPLICATION_JSON)

      // Fetch request and return content
      .execute().returnContent();

      // Print content
      System.out.println(content);
    }
    catch (IOException e) { System.out.println(e); }
  }
}
  • Node.js 样例
(function(callback) {
    'use strict';

    const httpTransport = require('https');
    const responseEncoding = 'utf8';
    const httpOptions = {
        hostname: 'cloudapi.linkface.cn',
        port: '443',
        path: '/data/check_multi_applications',
        method: 'POST',
        headers: {"Content-Type":"application/json; charset=utf-8"}
    };
    httpOptions.headers['User-Agent'] = 'node ' + process.version;

    // Paw Store Cookies option is not supported

    const request = httpTransport.request(httpOptions, (res) => {
        let responseBufs = [];
        let responseStr = '';

        res.on('data', (chunk) => {
            if (Buffer.isBuffer(chunk)) {
                responseBufs.push(chunk);
            }
            else {
                responseStr = responseStr + chunk;            
            }
        }).on('end', () => {
            responseStr = responseBufs.length > 0 ? 
                Buffer.concat(responseBufs).toString(responseEncoding) : responseStr;

            callback(null, res.statusCode, res.headers, responseStr);
        });

    })
    .setTimeout(0)
    .on('error', (error) => {
        callback(error);
    });
    request.write("{\"api_id\":\"API_ID\",\"api_secret\":\"API_SECRET\",\"id_number\":\"110xxxxxxxxxxxxxxx\",\"name\":\"NAME\"}")
    request.end();


})((error, statusCode, headers, body) => {
    console.log('ERROR:', error); 
    console.log('STATUS:', statusCode);
    console.log('HEADERS:', JSON.stringify(headers));
    console.log('BODY:', body);
});

results matching ""

    No results matching ""