使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
使用 Submission API
使用 Submission API
本页介绍了如何使用 Submission API 将您认为不安全的网址提交至安全浏览进行分析。经确认符合安全浏览政策的所有网址都将添加到安全浏览服务中。
准备工作
如要获取此功能,请联系我们的销售团队或您的客户工程师。
提交网址
如要提交网址,请向 projects.submissions.create
方法发送 HTTP POST
请求。
API 请求
在使用任何请求数据之前,请先进行以下替换:
PROJECT_ID:您的 Google Cloud 项目 ID
HTTP 方法和网址:
POST https://webrisk.googleapis.com/v1/projects/PROJECT-ID/submissions
请求 JSON 正文:
{
"uri": "https://www.phishingsite.com/",
}
如需发送请求,请选择以下方式之一:
curl
将请求正文保存在名为 request.json
的文件中,然后执行以下命令:
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://webrisk.googleapis.com/v1/projects/PROJECT-ID/submissions"
PowerShell
将请求正文保存在名为 request.json
的文件中,然后执行以下命令:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://webrisk.googleapis.com/v1/projects/PROJECT-ID/submissions" | Select-Object -Expand Content
您应该收到类似以下内容的 JSON 响应:
{
"uri": "https://www.phishingsite.com/",
}
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-09-04。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[],[],null,["Using the Submission API\n\nUsing the Submission API\n========================\n\n|\n| **Preview**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nThis page explains how to use the Submission API to submit URLs that you suspect\nare unsafe to Safe Browsing for analysis. Any URLs that are confirmed to match\nthe [Safe Browsing policies](https://safebrowsing.google.com/#policies) are\nadded to the Safe Browsing service.\n\nBefore you begin\n----------------\n\n[Contact our sales team](https://go.chronicle.security/webriskapi) or your customer\nengineer to obtain access to this feature.\n\nSubmitting URLs\n---------------\n\nTo submit a URL, send an HTTP `POST` request to\nthe [`projects.submissions.create`](/web-risk/docs/reference/rest/v1/projects.submissions/create)\nmethod.\n\n### API request\n\n\nBefore using any of the request data,\nmake the following replacements:\n\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: your Google Cloud project ID\n\n\nHTTP method and URL:\n\n```\nPOST https://webrisk.googleapis.com/v1/projects/PROJECT-ID/submissions\n```\n\n\nRequest JSON body:\n\n```\n{\n \"uri\": \"https://www.phishingsite.com/\",\n}\n```\n\nTo send your request, choose one of these options: \n\n#### curl\n\n| **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](/sdk/gcloud/reference/init) or [`gcloud auth login`](/sdk/gcloud/reference/auth/login) , or by using [Cloud Shell](/shell/docs), which automatically logs you into the `gcloud` CLI . You can check the currently active account by running [`gcloud auth list`](/sdk/gcloud/reference/auth/list).\n\n\nSave the request body in a file named `request.json`,\nand execute the following command:\n\n```\ncurl -X POST \\\n -H \"Authorization: Bearer $(gcloud auth print-access-token)\" \\\n -H \"Content-Type: application/json; charset=utf-8\" \\\n -d @request.json \\\n \"https://webrisk.googleapis.com/v1/projects/PROJECT-ID/submissions\"\n```\n\n#### PowerShell\n\n| **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](/sdk/gcloud/reference/init) or [`gcloud auth login`](/sdk/gcloud/reference/auth/login) . You can check the currently active account by running [`gcloud auth list`](/sdk/gcloud/reference/auth/list).\n\n\nSave the request body in a file named `request.json`,\nand execute the following command:\n\n```\n$cred = gcloud auth print-access-token\n$headers = @{ \"Authorization\" = \"Bearer $cred\" }\n\nInvoke-WebRequest `\n -Method POST `\n -Headers $headers `\n -ContentType: \"application/json; charset=utf-8\" `\n -InFile request.json `\n -Uri \"https://webrisk.googleapis.com/v1/projects/PROJECT-ID/submissions\" | Select-Object -Expand Content\n```\n\nYou should receive a JSON response similar to the following:\n\n```\n{\n \"uri\": \"https://www.phishingsite.com/\",\n}\n```"]]