آموزش کار با Manage API Tokens در cpanel

آموزش کار با Manage API Tokens در cpanel

دوستان عزیز پیشگام وبی امیدوارم که حالتون خوب باشه ، امروز با آموزش کار با Manage API Tokens در cpanel خدمتتون هستیم و امیدوارم توضیحاتی که در این مطلب و یا در انتها مطلب که بصورت فیلم قرارداده شده بتونه به شما کمک کنه و هر روز بیشتر پیشرفت کنید.

خوب اصلا این قسمت به چه دردی میخوره کجا بهش نیاز داریم و در کل کاربردش چی هست؟

این قسمت برای تغییر پسورد در سی پنل میباشد که با عنوان Manage API Tokens در قسمت Security موجود میباشد.

ابتدا وارد هاستمون داخل سایت پیشگام وب میشیم.

میتوانیم از سرویس های من ورود به سی پنل رو میزنید تا بصورت اتوماتیک وارد هاستمون بشیم.

Manage API Tokens در cpanel

بعد از ورود به هاست به قسمت Security رفته و روی گزینه Manage API Tokens کلیک کنید.

در ابتدا هشدار داده که این مورد آزمایشی هست.

Warning: The API Tokens feature is experimental.

در قسمت API Token Name نام مورد نظر را برای API خود وارد کنید.

در قسمت Should the API Token Expire? شما میتوانید دو حالت را انتخاب کنید اگر The API Token will not expire. را انتخاب کنید این API تاریخ انقضا نخواهد داشت و اگر Specify an expiration date. را انتخاب کنید میتوانید تاریخ انقضا را وارد کنید.

در پایین آن هم اخطاری در مورد دسترسی داده است.

Danger: The API token can access every API that you can access.

در انتها روی گزینه Create کلیک کنید.

در قسمت API Tokens هم میتوانید آن را کپی کنید.

تیک گزینه Create another token after I click Yes, I saved my token. را بزنید و روی گزینه Yes, I saved my token کلیک کنید.

اگر مجدد به همین قسمت مراجعه کنید میتوانید مورد ساخته شده را مشاهده کنید همراه با تاریخ ساخت و تاریخ انقضا اگر روی گزینه manege کلیک کنید میتوانید API مورد نظر را مدیریت کنید و همچنین میتوانید موردی را حذف کنید.

مشاهده فیلم آموزش از وب سایت آپارات

 

برای دانلود فیلم آموزش از قسمت تنظیمات روی گزینه دانلود کلیک کرده و کیفیت مد نظر خود را انتخاب کنید تا فیلم آموزش دانلود گردد.

نکته : هر چقدر که عدد این قسمت بیشتر باشد ، کیفیت فیلم دانلودی بالاتر خواهد بود.

آموزش های متوسطه :

دوستان عزیز آموزش که خدمتتون ارائه کردیم از سری آموزش های ابتدایی پیشگام وب هست و این آموزش جزو آموزش های متوسطه هست که باعث میشه شما بتونید سایتتون رو بهتر از قبل مدیریت کنید.

این آموزش ها به شما کمک میکنه تا به مرور زمان به یک طراح سایت تبدیل بشید و اون رو به عنوان شغل خودتون انتخاب کنید و اگر هم قصد ندارید به عنوان شغل بهش نگاه کنید میتوانید پشتیبانی سایت خودتان را در دست بگیرید.

learn in cpanel

Overview

In cPanel & WHM version 80, we introduced cPanel application programming interface (API) tokens. cPanel users can issue these API tokens. The server recognizes API tokens and allows other users to run API functions with the account’s data. API functions allow you to view and change account data without the need to log in to the cPanel interface. For example, you could issue an API token to a third-party developer. That third-party developer could use that token to check disk usage.

Note:
  • API tokens run UAPI functions and cPanel API 2 functions, not cPanel API 1 functions. For more information, read our Quickstart Development Guide documentation.
  • If you do not see this feature, your system administrator has disabled it. Contact them and ask them to enable this feature in WHM’s Feature Manager interface (WHM >> Home >> Package >> Feature Manager).

How to use a cPanel API token

To use a cPanel API token, first, create a cPanel API token in cPanel’s Manage API Tokens interface (cPanel >> Home >> Security >> Manage API Tokens). Then, use the token to run API functions on the server.

Create an API token

You can use one of the following methods to create an API token:

  • Use cPanel’s Manage API Tokens interface (cPanel >> Home >> Security >> Manage API Tokens).

  • Use the UAPI Tokens::create_full_access function.

Note:
  • In cPanel & WHM version 82, when an API token expires, the system does not remove it. You must manually delete an API token.
  • You can remove an API token with cPanel’s Manage API Tokens interface (cPanel >> Home >> Security >> Manage API Tokens) or the UAPI Tokens::revoke function.

Run API functions with the token

Remember:

You must use the API token that you created in cPanel.

To call a UAPI or cPanel API 2 function with an API token, run the following command from the command line:

curl -H'Authorization: cpanel username:APITOKEN' 'https://example.com:2083/execute/Module/function?parameter=value'

This example uses the following format:

Item Description Example
username The cPanel account’s username. username
APITOKEN The API token. U7HMR63FGY292DQZ4H5BFH16JLYMO01M
example.com Your cPanel server’s domain. example.com
Note:
Alternatively, you can enter your server’s IP address.
Module The API module name. Email
function The API function’s name. add_pop
parameter The function’s input parameters. email
value The value to assign to the input parameter. 12345luggage

For example, your command may resemble the following example:

curl -H'Authorization: cpanel username:U7HMR63FHY282DQZ4H5BIH16JLYSO01M' 
درباره نویسنده

نظرات شما


× 8 = پنجاه شش

14 + 4 =