首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >运营商三要素实名认证接口(姓名、身份证号、手机号)

运营商三要素实名认证接口(姓名、身份证号、手机号)

作者头像
很酷的站长
发布于 2022-12-16 13:51:32
发布于 2022-12-16 13:51:32
3.6K00
代码可运行
举报
运行总次数:0
代码可运行
1. 前言

姓名、身份证号码二要素实名认证接口约 0.3元/次

姓名、身份证号码、手机号码二要素实名认证接口约 0.35元/次

2. 代码示例

将下面代码中的 appcode 改为自己的即可使用

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
/**
* 身份实名认证接口(三要素)
*
* @param $name 姓名
* @param $idcard 身份证号
* @param $mobile 手机号码
* @return true|false 认证成功|认证失败
*/
function auth($name, $idcard, $mobile)
{
$host = "https://mobile3elements.shumaidata.com";
$path = "/mobile/verify_real_name";
$method = "POST";
$appcode = "xxxxxxxxxxxxxxxxxxxx";
$headers = array();
array_push($headers, "Authorization:APPCODE " . $appcode);
//根据API的要求,定义相对应的Content-Type
array_push($headers, "Content-Type" . ":" . "application/x-www-form-urlencoded; charset=UTF-8");
$querys = "";
$bodys = "idcard={$idcard}&mobile={$mobile}&name=" . urlencode($name);
$url = $host . $path;
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_FAILONERROR, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
//设定返回信息中是否包含响应信息头
// 启用时会将头文件的信息作为数据流输出,true 表示输出信息头, false表示不输出信息头
//如果需要将字符串转成json,请将 CURLOPT_HEADER 设置成 false
curl_setopt($curl, CURLOPT_HEADER, false);
if (1 == strpos("$" . $host, "https://")) {
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
}
curl_setopt($curl, CURLOPT_POSTFIELDS, $bodys);
$result = curl_exec($curl);
####### 接口返回值记录到日志文件 #######
// ....
####### 接口返回值记录到日志文件 / #######
if (isset($result['code']) && $result['code'] == 0 && $result['result']['res'] == 1) {
return true; // 三要素信息一致
} else {
return false;
}
}
3. 返回值示例

姓名、身份证号、手机号三要素信息完全一致时的返回值

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
{
"code":"0",
"message":"成功",
"result":{
"name":"李易峰",
"mobile":"1736705xxxx",
"idcard":"41092819990917xxxx",
"res":"1",
"description":"一致",
"sex":"男",
"birthday":"19990917",
"address":"河南省濮阳市濮阳县"
}
}

当 appcode 没有填写或是错误的值时返回空字符串

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
""
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
暂无评论
推荐阅读
编辑精选文章
换一批
leetcode: 82. Remove Duplicates from Sorted List II
Problem # Given a sorted linked list, delete all nodes that have duplicate numbers, # leaving only distinct numbers from the original list. # # For example, # Given 1->2->3->3->4->4->5, return 1->2->5. # Given 1->1->1->2->3, return 2->3. AC class ListNo
JNingWei
2018/09/27
2760
Q83 Remove Duplicates from Sorted List
Given a sorted linked list, delete all duplicates such that each element appear only once. For example, Given 1->1->2, return 1->2. Given 1->1->2->3->3, return 1->2->3. 解题思路: 链表删除操作的应用,即 cur.next = cur.next.next,时间复杂度为 O(n)。 Python实现: # Definition for si
echobingo
2018/04/25
7330
83. Remove Duplicates from Sorted List(Linked List-Easy)
该文讲述了如何删除排好序的链表中的重复元素,使得每个元素只出现一次。首先,定义一个虚拟头节点,然后遍历链表,如果当前节点和下一个节点的值相同,则将下一个节点的next指针指向当前节点的next指针,最后返回虚拟头节点的下一个节点即可。对于给定的链表1->1->2,返回的是1->2;对于链表1->1->2->3->3,返回的是1->2->3。
Jack_Cui
2018/01/08
5760
leetcode 83 Remove Duplicates from Sorted List
Given a sorted linked list, delete all duplicates such that each element appear only once.
流川疯
2019/01/18
4040
leetcode: 86. Partition List
Problem # Given a linked list and a value x, # partition it such that all nodes less than x come before nodes greater than or equal to x. # # You should preserve the original relative order of the nodes in each of the two partitions. # # For example, #
JNingWei
2018/09/27
4150
LeetCode-83-删除排序链表中的重复元素
初始化1个指针,指向头部,判断后一个数和前一个是不是相等,相等则要把后面一个数覆盖前面一个数,当发现不相等时,cur指针顺移1位,即对于1、1、2、3、3这样的数据,cur会将后一个重复的数字替换前一个重复数字,当重复数字之后一位数不和当前相等时,cur指针改变指向到下一个数,再进行重复判断。
benym
2022/07/14
1620
LinkedList - 82. Remove Duplicates from Sorted List II
82. Remove Duplicates from Sorted List II
ppxai
2020/09/23
3270
leetcode: 61. Rotate List
Problem # Given a list, rotate the list to the right by k places, where k is non-negative. # # Example: # Given 1->2->3->4->5->NULL and k = 2, # return 4->5->1->2->3->NULL. AC class ListNode: def __init__(self, x): self.val = x self
JNingWei
2018/09/27
4420
leetcode: 19. Remove Nth Node From End of List
Problem # Given a linked list, remove the nth node from the end of list and return its head. # # For example, # # Given linked list: 1->2->3->4->5, and n = 2. # # After removing the second node from the end, the linked list becomes 1->2->3->5. # # Note
JNingWei
2018/09/28
2690
Leetcode【61、82、83、142、143、1171】
1、先计算链表长度 size,k = k % size,如果 k % size == 0,则不用移动,直接返回 head; 2、否则,需要将前 size - k 个结点移动到后面。因此只需要循环 size - k 次,找到新链表头部,然后进行指针的交换。最后返回新链表头即可。
echobingo
2019/10/29
5290
七十一、去重交换排序链表、 求链表的中间结点
最近在重新梳理学算法的知识,本文为链表常见操作复习的总结文章,会讲解常见的链表题目实现思路及附上答案,这些题目在leetcode上对应的题号也有给出,好好学习算法吧~
润森
2022/08/17
4670
七十一、去重交换排序链表、 求链表的中间结点
画解算法:83. 删除排序链表中的重复元素
https://leetcode-cn.com/problems/remove-duplicates-from-sorted-list/
灵魂画师牧码
2019/06/27
3720
画解算法:83. 删除排序链表中的重复元素
[LeetCode] 82. Remove Duplicates from Sorted List II
该文讲述了如何删除排序链表中的重复节点,并保留非重复节点。通过先构建一个虚拟头节点来处理头结点,然后遍历链表,如果当前节点和下一个节点的值相同,则删除当前节点,否则将当前节点和下一个节点连接起来。遍历结束后,返回虚拟头节点的下一个节点即可。该解法使用了递归和虚拟头节点,具有较高的效率和可读性。
用户1148830
2018/01/04
7100
字节面试题 leetcode 83. 删除排序链表中的重复元素
今天给大家分享一道字节跳动的面试题,也就是 Leetcode 83. 删除排序链表中的重复元素,提供三种(递归、迭代(单指针、双指针))解题思路,供大家参考。
程序员小熊
2021/05/28
3670
字节面试题 leetcode 83. 删除排序链表中的重复元素
LinkedList - 83. Remove Duplicates from Sorted List
Given a sorted linked list, delete all duplicates such that each element appear only once.
ppxai
2020/09/23
3030
leetcode: 92. Reverse Linked List II
Problem # Reverse a linked list from position m to n. Do it in-place and in one-pass. # # For example: # Given 1->2->3->4->5->NULL, m = 2 and n = 4, # # return 1->4->3->2->5->NULL. # # Note: # Given m, n satisfy the following condition: # 1 ≤ m ≤ n ≤ le
JNingWei
2018/09/27
3290
【Leetcode】82. 删除排序链表中的重复元素 II
给定一个排序链表,删除所有含有重复数字的节点,只保留原始链表中 没有重复出现 的数字。
Leetcode名企之路
2018/10/25
6260
【Leetcode】82. 删除排序链表中的重复元素 II
【2025-02-28】基础算法:前后指针
📝前言说明: ●本专栏主要记录本人的基础算法学习以及LeetCode刷题记录,主要跟随B站博主灵茶山的视频进行学习,专栏中的每一篇文章对应B站博主灵茶山的一个视频 ●题目主要为B站视频内涉及的题目以及B站视频中提到的“课后作业”。 ●文章中的理解仅为个人理解。 ●文章中的截图来源于B站博主灵茶山,如有侵权请告知。
用户11029137
2025/03/01
890
【2025-02-28】基础算法:前后指针
LeetCode笔记:83. Remove Duplicates from Sorted List
既然链表本身已经排好序了,那么只用比较当前位置的值和next的值是否一样,一样就把next指向下一个再继续判断就好了,思路还是比较简单,但是有几个容易忽略的点需要注意。
Cloudox
2021/11/23
1360
Leetcode 83 Remove Duplicates from Sorted List
Given a sorted linked list, delete all duplicates such that each element appear only once. For example, Given 1->1->2, return 1->2. Given 1->1->2->3->3, return 1->2->3. 删除链表中的重复元素,快慢指针解决! /** * Definition for singly-linked list. * struct ListNode {
triplebee
2018/01/12
5600
相关推荐
leetcode: 82. Remove Duplicates from Sorted List II
更多 >
LV.1
阿里巴巴图像算法
交个朋友
加入腾讯云官网粉丝站
蹲全网底价单品 享第一手活动信息
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档