检查 URL 资源验证结果
您可以使用本接口检查 URL 资源(网域或网址前缀)的所有权验证结果。
欲了解添加和验证 URL 资源的详细步骤,参阅管理 URL 资源。
重要提示
自 2025 年 10 月 15 日起,使用此接口时需要同时指定开发者应用的密钥。注意
为避免网址前缀验证失败,请在检查验证结果前确认以下细节:
- 验证文件上传后,是可公开访问的。
- 上传后的文件名与参数
file_name的值一致。若文件名中出现额外的 ".txt" 文件扩展名,需将其删除,确保文件名格式正确,即只包含一个 ".txt" 文件扩展名。
请求
地址 https://business-api.tiktok.com/open_api/v1.3/business/property/verify/
方法 POST
Header
|字段{30%}|类型{15%}|描述{55%}|
|---|---|---|
|Content-Type {必填}|string|请求信息类型。<br>允许格式:`application/json`。|
参数
|字段{30%}|类型{15%}|描述{55%}|
|---|---|---|
| app_id {必填} | string |开发者应用ID。<br><br>若想获取<strong>应用ID</strong>,您可以导航至<strong>[应用管理](https://business-api.tiktok.com/portal/apps)</strong> > <strong>App Detail</strong> > <strong>基本信息</strong>。|
|secret {必填}|string| 开发者应用密钥。<br><br>若想获取<strong>密钥</strong>,可以导航至<strong>[应用管理](https://ads.tiktok.com/marketing_api/apps/)</strong> > <strong>App Detail</strong> > <strong>基本信息</strong>。|
|url_property_meta {必填} | object | 您想要检查对应所有权验证结果的 URL 资源的信息。 |
#| property_type {必填} | integer | URL 资源的类型。 <br>枚举值: <ul><li>1:网域。</li><li>2:网址前缀。</li></ul>|
#| url {必填} | string | 您想要检查对应所有权验证结果的自有 URL。需根据您指定的 `property_type` 传入对应 URL。<ul><li>若 `property_type` 设置为 1,则需要指定基本域(例如,`example.com`)或子域(例如,`subdomain.example.com`)。</li><li>若 `property_type` 设置为 2,则需要指定由以下内容组成的网址前缀:`https://` + 主机名(必须是域名)+ 路径 + `/`,并且网址前缀不可重定向至其他 URL。例如,在网址前缀 `https://www.example.com/folder/` 中,主机名是域名 `www.example.com`,路径是 `/folder`。</li></ul> <br><p><span style="color:darkred"><b>注意</b></span>:您需传入一个您已通过[/business/property/add/](1769325280876545.html)添加至广告账户的 URL 资源。否则,将出现报错。需注意已验证的域名对应的子域名不需要单独验证,因为子域名将自动视作已验证。|
示例
(code curl http)
curl --location --request POST 'https://business-api.tiktok.com/open_api/v1.3/business/property/verify/' \
--header 'Content-Type: application/json' \
--data '{
"app_id": "{{app_id}}",
"secret": "{{secret}}",
"url_property_meta": {
"property_type": {{property_type}},
"url": "{{url}}"
}
}'
(/code)
返回
|字段{30%}|类型{15%}|描述{55%}|
|---|---|---|
|code |number| 返回码。完整返回码列表及描述,参见 [附录 - 返回码](https://ads.tiktok.com/marketing_api/docs?id=1737172488964097)。|
|message |string| 返回信息。更多信息参见 [附录 - 返回码](https://ads.tiktok.com/marketing_api/docs?id=1737172488964097)。 |
|request_id |string| 请求的日志ID,唯一标识一个请求。 |
|data |object| 返回数据。 |
#| url_property_info | object | URL 资源的所有权验证结果信息。 |
##| property_type| integer | URL 资源的类型。 <br>枚举值: <ul><li>1:网域。</li><li>2:网址前缀。</li></ul>|
##| url | string | 所指定的自有 URL。 |
##| property_status | integer | URL 资源的验证状态。<br>枚举值: <ul><li> 1:已验证。</li><li>2:由于验证尝试失败而未验证。您需要重新验证 URL 资源。</li></ul> |
##| signature | string | 在所有权验证过程中要使用的签名字符串。 |
##| file_name | string | 在所有权验证过程中要使用的签名文件名。 |
示例
(code Success-Response http)
HTTPS/1.1 200 OK
{
"code": 0,
"message": "OK",
"request_id": "{{request_id}}",
"data": {
"url_property_info": {
"file_name": "{{file_name}}",
"property_status": 1,
"property_type": {{property_type}},
"signature": "{{signature}}",
"url": "{{url}}"
}
}
}
(/code)