Method assetlinks.check
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
يحدِّد هذا الإعداد ما إذا كانت العلاقة (الاتجاهية) المحدَّدة موجودة بين مواد العرض المصدر والهدف المحدّدة.
تصف العلاقة الغرض من الرابط بين مادتَي العرض كما تمّت المطالبة بملكيته من خلال مادة العرض المصدر. ومثال على هذه العلاقات هو تفويض الامتيازات أو الأذونات.
غالبًا ما تستخدم أنظمة البنية الأساسية هذا الأمر للتحقق من الشروط المسبقة لإجراء ما. على سبيل المثال، قد يرغب العميل في معرفة ما إذا كان من المقبول إرسال عنوان URL ويب إلى تطبيق جوّال معيّن بدلاً من ذلك. يمكن للعميل التحقّق من رابط مادة العرض ذي الصلة من الموقع الإلكتروني إلى التطبيق المتوافق مع الأجهزة الجوّالة لتحديد ما إذا كان يجب السماح بالعملية.
ملاحظة حول الأمان: إذا حدّدت مادة عرض آمنة كمصدر، مثل موقع إلكتروني يستخدم HTTPS أو تطبيق متوافق مع Android، ستضمن واجهة برمجة التطبيقات أنّ مالك مادة العرض تلك قد استخدمها بطريقة آمنة لإنشاء الردّ. في المقابل، إذا كانت مادة العرض المصدر هي موقع إلكتروني غير آمن يستخدم بروتوكول HTTP (أي أنّ عنوان URL يبدأ بـ http://
بدلاً من https://
)، لن تتمكّن واجهة برمجة التطبيقات من التحقّق من صحة عبارات الموقع الإلكتروني بشكل آمن، ولا يمكن التأكد من أنّ عبارات الموقع الإلكتروني لم تعدّلها جهة خارجية. لمزيد من المعلومات، يُرجى الاطّلاع على مواصفات التصميم الفني لروابط مواد العرض الرقمية.
طلب HTTP
GET https://digitalassetlinks.googleapis.com/v1/assetlinks:check
معلمات طلب البحث
اسم المعلَمة |
النوع |
الوصف |
source |
object(Asset ) |
المصدر الذي يستضيف قائمة العبارات. ويُستخدَم هذا لتوجيه طلب Check() إلى المصدر الصحيح. |
relation |
string |
سلسلة طلب البحث للعلاقة. نحدد العلاقات بسلاسل التنسيق <kind>/<detail> ، حيث يجب أن تكون <kind> واحدة من مجموعة فئات الأغراض المحددة مسبقًا، و<detail> هي سلسلة أبجدية رقمية صغيرة بصيغة حرة تصف حالة الاستخدام المحددة للعبارة. راجِع مستندات واجهة برمجة التطبيقات للاطّلاع على القائمة الحالية للعلاقات المتوافقة. لكي يتطابق طلب بحث مع رابط مادة عرض، يجب أن تتطابق سلاسل العلاقة بين طلب البحث ورابط مادة العرض تمامًا. مثال: استعلام ذو علاقة 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 |
تشير هذه السمة إلى المدة التي يُعتبر بعدها الردّ صالحًا لمنع إجراء المزيد من التعديلات. مطلوب مدة بالثواني تضم تسعة أرقام كسور كحد أقصى، ويتم إنهاؤها بعبارة "s "، مثال: "3.5s" . |
debugString |
string |
رسالة يمكن للمستخدم قراءتها وتحتوي على معلومات تهدف إلى مساعدة المستخدمين النهائيين على فهم النتيجة وإعادة إنتاجها وتصحيح الأخطاء فيها. ستكون الرسالة باللغة الإنجليزية ولا نخطط في الوقت الحالي لتقديم أي ترجمات. يُرجى ملاحظة أنّه لا يتم تقديم أي ضمانات بشأن محتوى هذه السلسلة أو تنسيقها. قد يخضع أي جانب من جوانب هذه المعلومات للتغيير بدون إشعار. يجب عدم محاولة تحليل هذه البيانات آليًا. في حال كنت تعتقد أنّ عليك إجراء ذلك لأنّ واجهة برمجة التطبيقات لا تكشف عن المعلومات التي تحتاجها، يُرجى التواصل معنا أولاً. |
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2024-06-26 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2024-06-26 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\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."]]