API:Assert/ar

The action API provides some parameters which you can add to any request to verify certain conditions before the API request is served.

The available parameters are:


 *  : Checks that you are not using a user account
 *  : Checks that you are using a user account
 *  : يتحقق من أن حسابك يتمتع بحق المستخدم «bot»
 *  : Checks that your account is the expected user

Note that  will also fail, and   will also succeed, for temporary users.

لو لم ينجح التأكّد، سوف تحصل على أكواد الخطأ  أو.

Rationale and use cases
These parameters are intended as a second line of defense against two kinds of problems:

Bot operator errors
It's easy for a simple operator error to cause a lot of bad edits, such as the bot running on the wrong wiki or under the wrong username, especially if you're running more than one bot task. The  and   parameters are intended to help prevent those mistakes.

Login session expiration
After logging in, the cookies you receive are only valid for 30 days by default, after which time your bot will become logged out, and may continue working with its actions being attributes to the IP address or a temporary username (if logged-out users are allowed to perform them). The  parameter is intended to prevent this.

Switching user accounts
Interactive tools (in the browser) using the API to edit often want to make sure the user understands how their work will be attributed. When the user logs in or out in another browser tab (or their login session expires), this won't be immediately reflected in the tool's interface, but the new login session will be used for saving actions. The  and   parameters are intended to allow detecting this scenario and displaying an appropriate message before continuing.



التحقق من أنك مسجل الدخول
لو كنت لا ترغب في سوى التحقق من أنك مسجل الدخول إلى واجهة برمجة التطبيقات التي تحمل اسم Action أم لا، يمكنك إصدار طلب مستخدمًا المتغيرات. سيكون رد هذا الطلب هو رد بسيط خالي (أي  بصيغة جيسون) لو كنت مسجل الدخول بالفعل، أو خطأ   لو لم تكن مسجل الدخول.

في المعتاد لن تحتاج لعمل هذا. خلاف ذلك، أضف المتغير  إلى كافة الطلبات التي يجب أن تصدر من مستخدم مسجل الدخول.