Method assetlinks.check
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
พิจารณาว่ามีความสัมพันธ์ที่ระบุ (ทิศทาง) ระหว่างชิ้นงานแหล่งที่มาและเป้าหมายที่ระบุหรือไม่
ความสัมพันธ์นี้จะอธิบายเจตนาของการลิงก์ระหว่างเนื้อหาทั้ง 2 รายการตามที่ชิ้นงานแหล่งที่มาอ้างสิทธิ์ ตัวอย่างของความสัมพันธ์ดังกล่าวคือการมอบสิทธิ์หรือสิทธิ์ต่างๆ
ระบบโครงสร้างพื้นฐานมักจะใช้คำสั่งนี้เพื่อตรวจสอบเงื่อนไขล่วงหน้าสำหรับการดำเนินการ ตัวอย่างเช่น ลูกค้าอาจต้องการทราบว่าสามารถส่ง URL เว็บไปยังแอปบนอุปกรณ์เคลื่อนที่แอปหนึ่งแทนได้ไหม ลูกค้าสามารถตรวจสอบลิงก์ชิ้นงานที่เกี่ยวข้องจากเว็บไซต์ไปยังแอปบนอุปกรณ์เคลื่อนที่เพื่อตัดสินใจว่าควรอนุญาตให้มีการดําเนินการหรือไม่
หมายเหตุเกี่ยวกับความปลอดภัย: หากคุณระบุแหล่งข้อมูลที่ปลอดภัยเป็นเนื้อหา เช่น เว็บไซต์ HTTPS หรือแอป Android API จะตรวจสอบว่าข้อความที่ใช้สร้างการตอบกลับนั้นสร้างขึ้นด้วยวิธีที่ปลอดภัยโดยเจ้าของเนื้อหานั้น ในทางกลับกัน หากเนื้อหาแหล่งที่มาเป็นเว็บไซต์ HTTP ที่ไม่ปลอดภัย (กล่าวคือ URL ขึ้นต้นด้วย http://
แทนที่จะเป็น https://
) API จะยืนยันข้อความของตนเองอย่างปลอดภัยไม่ได้ และจะไม่มั่นใจได้ว่าข้อความของเว็บไซต์ดังกล่าวไม่มีการเปลี่ยนแปลงโดยบุคคลที่สาม ดูข้อมูลเพิ่มเติมได้ที่ข้อกำหนดทางเทคนิคในการออกแบบลิงก์เนื้อหาดิจิทัล (Digital Asset Links)
คำขอ HTTP
GET https://digitalassetlinks.googleapis.com/v1/assetlinks:check
พารามิเตอร์การค้นหา
ชื่อพารามิเตอร์ |
ประเภท |
คำอธิบาย |
source |
object(Asset ) |
แหล่งที่มาที่โฮสต์รายการใบแจ้งยอด ใช้เพื่อกำหนดเส้นทางการเรียก Check() ไปยังต้นทางที่เหมาะสม |
relation |
string |
สตริงการค้นหาสำหรับความสัมพันธ์ เราจะระบุความสัมพันธ์กับสตริงของรูปแบบ <kind>/<detail> โดยที่ <kind> ต้องเป็นหนึ่งในชุดหมวดหมู่วัตถุประสงค์ที่กำหนดไว้ล่วงหน้า และ <detail> คือสตริงอักขระที่เป็นตัวอักษรและตัวเลขคละกันรูปแบบอิสระที่อธิบายถึงกรณีการใช้งานเฉพาะของคำสั่ง โปรดดูเอกสารประกอบของ API สำหรับรายการความสัมพันธ์ที่รองรับในปัจจุบัน ในการค้นหาจับคู่ลิงก์เนื้อหา ทั้งสตริงที่เกี่ยวข้องของการค้นหาและลิงก์เนื้อหาต้องตรงกันทุกประการ เช่น การค้นหาที่มีความสัมพันธ์ delegate_permission/common.handle_all_urls ตรงกับลิงก์ชิ้นงานที่มีความสัมพันธ์ delegate_permission/common.handle_all_urls |
target |
object(Asset ) |
เนื้อหาเป้าหมายของใบแจ้งยอด |
เนื้อหาของคำขอ
เนื้อหาของคำขอต้องว่างเปล่า
เนื้อหาการตอบกลับ
หากทำสำเร็จ เนื้อหาการตอบกลับจะมีข้อมูลซึ่งมีโครงสร้างดังต่อไปนี้
ข้อความตอบกลับสำหรับการโทร CheckAssetLinks
การแสดง JSON |
{
"linked": boolean,
"maxAge": string,
"debugString": string,
} |
ชื่อช่อง |
ประเภท |
คำอธิบาย |
linked |
boolean |
ตั้งค่าเป็น "จริง" หากเนื้อหาที่ระบุในคำขอลิงก์ตามความเกี่ยวข้องที่ระบุไว้ในคำขอ ต้องระบุ |
maxAge |
string |
ตั้งแต่เวลาที่แสดง การตอบกลับควรถือว่านานกว่าระยะเวลาใดหากจำเป็นต้องอัปเดตเพิ่มเติม ต้องระบุ ระยะเวลาเป็นวินาทีโดยมีเลขเศษส่วนไม่เกิน 9 หลัก สิ้นสุดด้วย "s " เช่น "3.5s" |
debugString |
string |
ข้อความที่มนุษย์อ่านได้ซึ่งมีข้อมูลเพื่อช่วยให้ผู้ใช้ปลายทางเข้าใจ ทำซ้ำ และแก้ไขข้อบกพร่องของผลลัพธ์ ข้อความจะเป็นภาษาอังกฤษและขณะนี้เราไม่ได้วางแผนที่จะให้บริการแปล โปรดทราบว่าไม่มีการรับประกันเกี่ยวกับเนื้อหาหรือรูปแบบของสตริงนี้ อาจมีการเปลี่ยนแปลงในด้านใดโดยไม่ต้องแจ้งให้ทราบล่วงหน้า คุณไม่ควรพยายามแยกวิเคราะห์ข้อมูลนี้แบบเป็นโปรแกรม หากคุณรู้สึกว่าจำเป็นต้องทำเช่นนี้เนื่องจาก API ไม่ได้เปิดเผยข้อมูลที่คุณต้องการ โปรดติดต่อเราก่อน |
ลองใช้เลย
ใช้โปรแกรมสำรวจ APIs เพื่อเรียกใช้เมธอดนี้กับข้อมูลแบบเรียลไทม์และดูการตอบกลับ
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2024-06-26 UTC
[null,null,["อัปเดตล่าสุด 2024-06-26 UTC"],[[["\u003cp\u003eVerifies the existence of a relationship between two digital assets, like websites and apps.\u003c/p\u003e\n"],["\u003cp\u003eUses the \u003ccode\u003eGET\u003c/code\u003e method with query parameters specifying the source, relation, and target assets.\u003c/p\u003e\n"],["\u003cp\u003eReturns a JSON response indicating if the assets are linked and provides additional debugging information.\u003c/p\u003e\n"],["\u003cp\u003ePrimarily used for security checks and ensuring the integrity of relationships between assets.\u003c/p\u003e\n"],["\u003cp\u003eOffers enhanced security when the source asset is secure (HTTPS or Android app).\u003c/p\u003e\n"]]],[],null,["# Method assetlinks.check\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.CheckResponse.SCHEMA_REPRESENTATION)\n- [Try it!](#try-it)\n\nDetermines whether the specified (directional) relationship exists between the specified source and target assets.\n\nThe relation describes the intent of the link between the two assets as claimed by the source asset. An example for such relationships is the delegation of privileges or permissions.\n\nThis command is most often used by infrastructure systems to check preconditions for an action. For example, a client may want to know if it is OK to send a web URL to a particular mobile app instead. The client can check for the relevant asset link from the website to the mobile app to decide if the operation should be allowed.\n\nA note about security: if you specify a secure asset as the source, such as an HTTPS website or an Android app, the API will ensure that any statements used to generate the response have been made in a secure way by the owner of that asset. Conversely, if the source asset is an insecure HTTP website (that is, the URL starts with `http://` instead of `https://`), the API cannot verify its statements securely, and it is not possible to ensure that the website's statements have not been altered by a third party. For more information, see the [Digital Asset Links technical design specification](https://github.com/google/digitalassetlinks/blob/master/well-known/details.md).\n\n### HTTP request\n\n`GET https://digitalassetlinks.googleapis.com/v1/assetlinks:check`\n\n### Query parameters\n\n| Parameter name | Type | Description |\n|----------------|-------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `source` | `object(`[Asset](/digital-asset-links/reference/rest/v1/Asset)`)` | The source hosting the statement list. This is used to route the `Check()` call to the proper source. |\n| `relation` | `string` | Query string for the relation. We identify relations with strings of the format `\u003ckind\u003e/\u003cdetail\u003e`, where `\u003ckind\u003e` must be one of a set of pre-defined purpose categories, and `\u003cdetail\u003e` is a free-form lowercase alphanumeric string that describes the specific use case of the statement. Refer to [our API documentation](/digital-asset-links/v1/relation-strings) for the current list of supported relations. For a query to match an asset link, both the query's and the asset link's relation strings must match exactly. Example: A query with relation `delegate_permission/common.handle_all_urls` matches an asset link with relation `delegate_permission/common.handle_all_urls`. |\n| `target` | `object(`[Asset](/digital-asset-links/reference/rest/v1/Asset)`)` | The target asset of the statement. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body contains data with the following structure:\nResponse message for the CheckAssetLinks call.\n\n| JSON representation |\n|-------------------------------------------------------------------------|\n| ``` { \"linked\": boolean, \"maxAge\": string, \"debugString\": string, } ``` |\n\n| Field name | Type | Description |\n|---------------|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `linked` | `boolean` | Set to true if the assets specified in the request are linked by the relation specified in the request. REQUIRED |\n| `maxAge` | `string` | From serving time, how much longer the response should be considered valid barring further updates. REQUIRED A duration in seconds with up to nine fractional digits, terminated by '`s`'. Example: `\"3.5s\"`. |\n| `debugString` | `string` | Human-readable message containing information intended to help end users understand, reproduce and debug the result. The message will be in English and we are currently not planning to offer any translations. Please note that no guarantees are made about the contents or format of this string. Any aspect of it may be subject to change without notice. You should not attempt to programmatically parse this data. If you feel that you need to do this because the information you need is not otherwise exposed by the API, please contact us first. |\n\nTry it!\n-------\n\nUse the [APIs Explorer](https://developers.google.com/apis-explorer/?discovery_url=/digital-asset-links/v1/discoverydocument.json#p/digitalassetlinks/v1/digitalassetlinks.assetlinks.check?relation=delegate_permission%252Fcommon.handle_all_urls&source.web.site=https%253A%252F%252Fexample.digitalassetlinks.org&target.androidApp.certificate.sha256Fingerprint=10%253A39%253A38%253AEE%253A45%253A37%253AE5%253A9E%253A8E%253AE7%253A92%253AF6%253A54%253A50%253A4F%253AB8%253A34%253A6F%253AC6%253AB3%253A46%253AD0%253ABB%253AC4%253A41%253A5F%253AC3%253A39%253AFC%253AFC%253A8E%253AC1&target.androidApp.packageName=org.digitalassetlinks.sampleapp) to call this method on live data and see the response."]]