Method assetlinks.check
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
تعیین می کند که آیا رابطه مشخص (جهت دار) بین منبع مشخص شده و دارایی هدف وجود دارد یا خیر.
این رابطه هدف از پیوند بین دو دارایی را همانطور که توسط دارایی منبع ادعا شده است، توصیف می کند. نمونه ای برای چنین روابطی تفویض امتیازات یا مجوزها است.
این دستور اغلب توسط سیستم های زیرساخت برای بررسی پیش شرط های یک اقدام استفاده می شود. به عنوان مثال، یک مشتری ممکن است بخواهد بداند که آیا ارسال URL وب به یک برنامه تلفن همراه خاص مشکلی ندارد یا خیر. مشتری می تواند پیوند دارایی مربوطه را از وب سایت به برنامه تلفن همراه بررسی کند تا تصمیم بگیرد که آیا عملیات باید مجاز باشد یا خیر.
نکته ای در مورد امنیت: اگر یک دارایی ایمن را به عنوان منبع مشخص کنید، مانند یک وب سایت HTTPS یا یک برنامه Android، API اطمینان حاصل می کند که هر عباراتی که برای ایجاد پاسخ استفاده می شود به روشی ایمن توسط صاحب آن دارایی بیان شده است. . برعکس، اگر دارایی منبع یک وبسایت HTTP ناامن باشد (یعنی نشانی اینترنتی به جای http://
با https://
شروع میشود)، API نمیتواند اظهارات آن را به طور ایمن تأیید کند، و نمیتوان از بیانیههای وبسایت اطمینان حاصل کرد. توسط شخص ثالث تغییر داده نشده است. برای اطلاعات بیشتر، مشخصات طراحی فنی پیوندهای دارایی دیجیتال را ببینید.
درخواست 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 | اگر دارایی های مشخص شده در درخواست با رابطه مشخص شده در درخواست به هم مرتبط باشند، روی true تنظیم کنید. مورد نیاز |
maxAge | string | از زمان ارائه، چه مدت دیگر پاسخ باید معتبر در نظر گرفته شود و بهروزرسانیهای بیشتر ممنوع شود. مورد نیاز مدت زمان در ثانیه با حداکثر نه رقم کسری که با ' s ' خاتمه می یابد. مثال: "3.5s" . |
debugString | string | پیام قابل خواندن توسط انسان حاوی اطلاعاتی است که برای کمک به کاربران نهایی در درک، بازتولید و اشکال زدایی نتیجه است. پیام به زبان انگلیسی خواهد بود و ما در حال حاضر قصد نداریم ترجمه ای ارائه دهیم. لطفاً توجه داشته باشید که هیچ تضمینی در مورد محتوا یا قالب این رشته وجود ندارد. هر جنبه ای از آن ممکن است بدون اطلاع قبلی تغییر کند. شما نباید سعی کنید این داده ها را به صورت برنامه نویسی تجزیه کنید. اگر احساس می کنید که باید این کار را انجام دهید زیرا اطلاعات مورد نیاز شما توسط API در معرض دید دیگری قرار نمی گیرد، لطفاً ابتدا با ما تماس بگیرید. |
آن را امتحان کنید!
از APIs Explorer برای فراخوانی این روش روی داده های زنده و دیدن پاسخ استفاده کنید.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-01-09 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-01-09 بهوقت ساعت هماهنگ جهانی."],[[["\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."]]