المتطلّبات الأساسية
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
قبل أن تتمكن من البدء في ترميز تطبيق العميل الأول، هناك بعض
بالأشياء التي يتعين عليك القيام بها، إذا لم تكن قد قمت بها بالفعل.
الحصول على حساب Google
تحتاج إلى حساب Google من أجل إنشاء مشروع في وحدة التحكم في واجهة Google API. إذا كان لديك حساب، أنت جاهز الآن.
قد تحتاج أيضًا إلى حساب Google منفصل لأغراض الاختبار.
تجربة Google AdMob
تفترض مستندات واجهة برمجة التطبيقات هذه أنك استخدمت Google AdMob، وأنك على دراية بمفاهيم برمجة الويب وتنسيقات بيانات الويب.
إذا لم تكن قد استخدمت Google AdMob، جرِّب واجهة المستخدم قبل بدء الترميز.
إنشاء مشروع لعميلك
قبل أن تتمكّن من إرسال طلبات إلى Google AdMob، عليك إعلام Google بعميلك وتفعيل إذن الوصول إلى واجهة برمجة التطبيقات. يمكنك إجراء ذلك باستخدام وحدة التحكم في واجهة Google API لإنشاء مشروع، وهو مجموعة مُعنوَنة من الإعدادات ومعلومات الوصول إلى واجهة برمجة التطبيقات، ولتسجيل تطبيقك.
لبدء استخدام واجهة برمجة تطبيقات AdMob، عليك أولاً
استخدام
أداة الإعداد، التي ترشدك خلال إنشاء مشروع في
وحدة التحكم في واجهة Google API، وتفعيل واجهة برمجة التطبيقات، وإنشاء بيانات الاعتماد.
التعرُّف على أساسيات REST
REST هو نمط من بنية البرامج التي توفر نهجًا مناسبًا ومتسقًا لطلب البيانات وتعديلها.
إنّ المصطلح REST هو اختصار لـ "تحويل الولاية التمثيلية". في سياق Google APIs، يشير ذلك إلى استخدام أفعال HTTP لاسترداد وتعديل تمثيلات البيانات التي خزنتها Google.
في نظام REST، يتم تخزين الموارد في مخزن بيانات؛ يرسل العميل طلبًا بأن الخادم ينفّذ إجراءً معينًا (مثل إنشاء مورد أو استرداده أو تحديثه أو حذفه)، وينفذ الخادم الإجراء ويرسل استجابة غالبًا في شكل تمثيل للمورد المحدد.
في واجهات برمجة التطبيقات RESTful من Google، يحدّد العميل إجراءً باستخدام فعل HTTP مثل POST
أو GET
أو PUT
أو DELETE
. يحدد موردًا من خلال معرف موارد منتظم (URI) فريد عالميًا بالصيغة التالية:
https://www.googleapis.com/apiName/apiVersion/resourcePath?parameters
ونظرًا لأن جميع موارد واجهة برمجة التطبيقات تتضمن معرفات موارد منتظمة (URI) فريدة يمكن الوصول إليها عبر HTTP، فإن REST تتيح التخزين المؤقت للبيانات ويتم تحسينها للعمل مع البنية الأساسية الموزعة على الويب.
قد تجد تعريفات الطريقة في مستندات معايير HTTP 1.1 مفيدة، وهي تشمل مواصفات GET
وPOST
وPUT
وDELETE
.
وضع REST في واجهة برمجة تطبيقات AdMob
ترتبط عمليات واجهة برمجة تطبيقات AdMob مباشرةً بأفعال HTTP في REST.
في ما يلي التنسيقات المحددة لمعرّفات الموارد المنتظمة (URI) لواجهة برمجة تطبيقات AdMob:
https://admob.googleapis.com/v1/resourcePath?parameters
يتم تلخيص المجموعة الكاملة من معرفات الموارد المنتظمة (URI) المستخدمة لكل عملية متوافقة في واجهة برمجة التطبيقات في مستند مرجع واجهة برمجة تطبيقات AdMob.
التعرّف على أساسيات JSON
تعرض واجهة برمجة تطبيقات AdMob البيانات بتنسيق JSON.
JSON (JavaScript Object Notation) هو تنسيق بيانات شائع ومستقل عن اللغة ويقدم تمثيلاً نصيًا بسيطًا بُنى البيانات العشوائية. لمزيد من المعلومات، راجع json.org.
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-08-31 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-08-31 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eBefore coding, you need a Google Account (potentially a separate one for testing) and familiarity with Google AdMob.\u003c/p\u003e\n"],["\u003cp\u003eYou must create a project in the Google API Console using the provided setup tool to enable API access for your client application.\u003c/p\u003e\n"],["\u003cp\u003eThe AdMob API utilizes RESTful architecture, meaning you should understand basic REST principles and HTTP verbs for interacting with resources.\u003c/p\u003e\n"],["\u003cp\u003eData is exchanged in JSON format, so familiarity with JSON structure and parsing is beneficial.\u003c/p\u003e\n"]]],[],null,["# Prerequisites\n\nBefore you can start coding your first client application, there are a few\nthings you need to do, if you haven't done them already.\n\nGet a Google Account\n--------------------\n\nYou need a [Google Account](https://www.google.com/accounts/NewAccount) in order to [create a project](#project) in the Google API Console. If you already have an account, then you're all set.\n\nYou might also want a separate Google Account for testing purposes.\n\nTry out Google AdMob\n--------------------\n\nThis API documentation assumes that you've used Google AdMob, and that you're familiar with web programming concepts and web data formats.\n\nIf you haven't used Google AdMob, then try out the [user interface](https://admob.google.com) before starting to code.\n\nCreate a project for your client\n--------------------------------\n\nBefore you can send requests to Google AdMob, you need to tell Google about your client and activate access to the API. You do this by using the Google API Console to create a project, which is a named collection of settings and API access information, and register your application.\n\nTo get started using AdMob API, you need to first\n[use\nthe setup tool](https://console.cloud.google.com/start/api?id=admob.googleapis.com&credential=client_key), which guides you through creating a project in the\nGoogle API Console, enabling the API, and creating credentials.\n\nLearn REST basics\n-----------------\n\nREST is a style of software architecture that provides a convenient and consistent approach to requesting and modifying data.\n\nThe term REST is short for \"[Representational State Transfer](https://en.wikipedia.org/wiki/Representational_state_transfer).\" In the context of Google APIs, it refers to using HTTP verbs to retrieve and modify representations of data stored by Google.\n\nIn a RESTful system, resources are stored in a data store; a client sends a request that the server perform a particular action (such as creating, retrieving, updating, or deleting a resource), and the server performs the action and sends a response, often in the form of a representation of the specified resource.\n\nIn Google's RESTful APIs, the client specifies an action using an HTTP verb such as `POST`, `GET`, `PUT`, or `DELETE`. It specifies a resource by a globally-unique URI of the following form: \n\n```\nhttps://www.googleapis.com/apiName/apiVersion/resourcePath?parameters\n```\n\nBecause all API resources have unique HTTP-accessible URIs, REST enables data caching and is optimized to work with the web's distributed infrastructure.\n\nYou may find the [method definitions](https://tools.ietf.org/html/rfc7231#section-4.3) in the HTTP 1.1 standards documentation useful; they include specifications for `GET`, `POST`, `PUT`, and `DELETE`.\n\n### REST in the AdMob API\n\nThe AdMob API operations map directly to REST HTTP verbs.\n\nThe specific formats for AdMob API URIs are: \n\n```\nhttps://admob.googleapis.com/v1/resourcePath?parameters\n```\n\nThe full set of URIs used for each supported operation in the API is summarized in the [AdMob API Reference](/admob/api/v1/reference/rest) document.\n\nLearn JSON basics\n-----------------\n\nThe AdMob API returns data in JSON format.\n\n\n[JSON](http://en.wikipedia.org/wiki/JSON) (JavaScript Object Notation) is a common, language-independent data format that provides a simple text representation of arbitrary data structures. For more information, see [json.org](http://www.json.org/).\n\n\u003cbr /\u003e"]]