列出所有手机验证
端点
GET https://api.verifik.co/v2/phone-validations
此服务检索所有手机验证列表,支持可选筛选与分页。您可以按项目、状态、类型及其他参数筛选,以查找特定的手机验证。
请求头
Content-Type
类型: String
必需: 必需
值: application/json
Authorization
类型: String
必需: 必需
值: Bearer {YOUR_ACCESS_TOKEN}
查询参数
page
类型: Number
必需: 否
分页页码(默认:1)。
limit
类型: Number
必需: 否
每页记录数(默认:10,最大:100)。
project
类型: String
必需: 否
按项目 ID 筛选。
status
类型: String
必需: 否
按状态筛选:new、sent、validated、failed。
type
类型: String
必需: 否
按类型筛选:validation、login、onboarding。
countryCode
类型: String
必需: 否
按国家代码筛选。
phone
类型: String
必需: 否
按手机号码筛选。
populates[]
类型: String
必需: 否
可选的关联数据数组。可用选项:client、project、projectFlow。
请求
- Node.js
- Python
- PHP
- Go
import axios from 'axios';
const options = {
method: 'GET',
url: 'https://api.verifik.co/v2/phone-validations',
params: {
page: 1,
limit: 10,
status: 'validated',
type: 'validation',
countryCode: '+1',
'populates[]': ['client', 'project']
},
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer <your_token>'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
import http.client
conn = http.client.HTTPSConnection("api.verifik.co")
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer <your_token>'
}
conn.request("GET", "/v2/phone-validations?page=1&limit=10&status=validated&type=validation&countryCode=%2B1&populates[]=client&populates[]=project", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.verifik.co/v2/phone-validations', [
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => 'Bearer <your_token>',
],
'query' => [
'page' => 1,
'limit' => 10,
'status' => 'validated',
'type' => 'validation',
'countryCode' => '+1',
'populates[]' => ['client', 'project']
]
]);
echo $response->getBody();
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
url := "https://api.verifik.co/v2/phone-validations?page=1&limit=10&status=validated&type=validation&countryCode=%2B1&populates[]=client&populates[]=project"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Bearer <your_token>")
client := &http.Client{}
res, _ := client.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
响应
- 200
- 400
{
"success": true,
"data": [
{
"_id": "phone_validation_123456789",
"client": {
"_id": "client_123456789",
"name": "Example Client",
"email": "client@example.com"
},
"project": {
"_id": "project_123456789",
"name": "Example Project",
"description": "Example project description"
},
"status": "validated",
"countryCode": "+1",
"phone": "1234567890",
"type": "validation",
"validationMethod": "verificationCode",
"expiresAt": "2024-01-15T11:30:00Z",
"attempts": 1,
"maxAttempts": 3,
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:32:00Z",
"validatedAt": "2024-01-15T10:32:00Z"
}
],
"pagination": {
"page": 1,
"limit": 10,
"total": 1,
"pages": 1
},
"signature": {
"dateTime": "April 11, 2023 12:25 PM",
"message": "Certified by Verifik.co"
}
}
{
"success": false,
"error": "Invalid query parameters",
"code": "INVALID_PARAMETERS"
}
功能
- 完整列表:检索您账户中的所有手机验证
- 分页:支持使用 page 与 limit 控制分页
- 高级筛选:按项目、状态、类型、国家代码与手机号码筛选
- 数据填充:包含客户端与项目等关联信息
- 多种状态:按状态筛选(new、sent、validated、failed)
- 国家代码:按国际国家代码进行特定筛选
- 多语言:支持 JavaScript、Python、PHP 和 Swift
- 详细信息:包含尝试次数、限制与验证时间戳