{"id":7201,"date":"2024-04-26T13:59:37","date_gmt":"2024-04-26T13:59:37","guid":{"rendered":"https:\/\/accuweb.cloud\/api\/docs\/8-6-1\/others\/personal-access-tokens\/"},"modified":"2024-05-01T15:40:35","modified_gmt":"2024-05-01T15:40:35","slug":"personal-access-tokens","status":"publish","type":"docs","link":"https:\/\/accuweb.cloud\/api\/docs\/latest\/others\/personal-access-tokens\/","title":{"rendered":"Personal-Access-Tokens"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"7201\" class=\"elementor elementor-7201\" data-elementor-post-type=\"docs\">\n\t\t\t\t<div class=\"elementor-element elementor-element-61edbf1 e-flex e-con-boxed e-con e-parent\" data-id=\"61edbf1\" data-element_type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-bf7a7c3 elementor-widget elementor-widget-text-editor\" data-id=\"bf7a7c3\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<style>\/*! elementor - v3.23.0 - 05-08-2024 *\/\n.elementor-widget-text-editor.elementor-drop-cap-view-stacked .elementor-drop-cap{background-color:#69727d;color:#fff}.elementor-widget-text-editor.elementor-drop-cap-view-framed .elementor-drop-cap{color:#69727d;border:3px solid;background-color:transparent}.elementor-widget-text-editor:not(.elementor-drop-cap-view-default) .elementor-drop-cap{margin-top:8px}.elementor-widget-text-editor:not(.elementor-drop-cap-view-default) .elementor-drop-cap-letter{width:1em;height:1em}.elementor-widget-text-editor .elementor-drop-cap{float:left;text-align:center;line-height:1;font-size:50px}.elementor-widget-text-editor .elementor-drop-cap-letter{display:inline-block}<\/style>\t\t\t\t<aside class=\"aside\">\n<div class=\"menu-items-wrap sticky\">\n<div class=\"menu-items\">\n<div class=\"menu-items-wrapp\">\n<div class=\"menu-item expanded open\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/aside><span class=\"image-left\"><img decoding=\"async\" src=\"https:\/\/www.virtuozzo.com\/application-platform-docs\/personal-access-tokens\/01-personal-access-tokens-logo.png\" alt=\"personal access tokens logo\" \/><\/span>\n<div class=\"content\">\n\n<strong>Personal Access Tokens<\/strong>\u00a0are an alternative approach to authenticate API requests in the platform, which, in comparison to the default session-based method, provides greater versatility and reliability.\n\nAmong advantages of tokens, the following ones can be highlighted:\n<ul>\n \t<li>multiple tokens can be generated at once to support different tasks<\/li>\n \t<li>simplified authentication with tokens (no need to perform additional request(s) to get a session) ensures smaller code-base and quicker response when using automation scripts<\/li>\n \t<li>your credentials (login and password) are not exposed within scripts<\/li>\n \t<li>tokens can authenticate just a specified part of the account functionality, so you can share them with co-workers and third-party assistants without creating a security breach<\/li>\n \t<li>tokens can be supplemented with the expiration date or manually revoked at any time<\/li>\n<\/ul>\nThe platform provides a fully functional visual interface for tokens management directly in the dashboard (starting with the 5.5 version), which makes it the preferable way to authenticate any API integration (especially on accounts with the\u00a0two-factor authentication\u00a0enabled):\n<ul>\n \t<li><a href=\"#managing-access-tokens\">Managing Access Tokens<\/a><\/li>\n \t<li><a href=\"#use\">Using Access Tokens<\/a><\/li>\n<\/ul>\n<h2 id=\"managing-access-tokens\" class=\"link_owner\">Managing Access Tokens<\/h2>\nBelow, we\u2019ll overview the process of personal access tokens management using the dashboard UI:\n\n1. Go to the\u00a0<strong>Settings<\/strong>\u00a0section by clicking on the same-named button at the top-right corner of the dashboard.<img decoding=\"async\" src=\"https:\/\/www.virtuozzo.com\/application-platform-docs\/personal-access-tokens\/02-user-account-settings.png\" alt=\"user account settings\" \/>\n\n2. In the opened frame, select the\u00a0<strong>Access Tokens<\/strong>\u00a0tab to view the list of all tokens on the account. The tools panel above the list provides access to the following buttons:\n<ul>\n \t<li><strong>Generate<\/strong>\u00a0&#8211; creates a new token by providing the description, expiration date and selecting the required API methods (either from predefined sets or manually)<\/li>\n \t<li><strong>Edit<\/strong>\u00a0&#8211; adjusts the existing token or regenerates it (i.e. sets a new name, while maintaining all other parameters)<\/li>\n \t<li><strong>Copy<\/strong>\u00a0&#8211; creates a new token using parameters of the existing one as a basis<\/li>\n \t<li><strong>Remove<\/strong>\u00a0&#8211; deletes selected token<\/li>\n \t<li><strong>Refresh<\/strong>\u00a0&#8211; displays the most recent changes to the list<\/li>\n<\/ul>\n<img decoding=\"async\" src=\"https:\/\/www.virtuozzo.com\/application-platform-docs\/personal-access-tokens\/03-access-tokens-settings.png\" alt=\"access tokens settings\" \/>\n\n3. While creating a new or adjusting the existing token, the following frame is displayed, allowing to adjust:\n<ul>\n \t<li><em><strong>Description<\/strong><\/em>\u00a0&#8211; custom description provided for token<\/li>\n \t<li><em><strong>Expires At<\/strong><\/em>\u00a0&#8211; the date in the\u00a0<em>dd-mm-yyyy<\/em>\u00a0format this token is valid till (can be regenerated after expiration)<\/li>\n \t<li><em><strong>API<\/strong><\/em>\u00a0&#8211; the name of the API requests set: predefined (<em>Extended Access<\/em>,\u00a0<em>IDE Plugins<\/em>,\u00a0<em>Marketplace<\/em>,\u00a0<em>Maven Plugin<\/em>) or\u00a0<em>Custom<\/em>\u00a0(with manually selected methods)<\/li>\n \t<li>use the\u00a0<em>Search<\/em>\u00a0field, the\u00a0<em>Only Checked<\/em>\u00a0filter and links to the API\u00a0<em>Docs<\/em>\u00a0(displayed upon hovering over the particular method) to configure required permissions for token<img decoding=\"async\" src=\"https:\/\/www.virtuozzo.com\/application-platform-docs\/personal-access-tokens\/04-generate-access-token.png\" alt=\"generate access token\" \/><\/li>\n<\/ul>\n4. All the token changes on account require an obligatory confirmation with the password before being applied.<img decoding=\"async\" src=\"https:\/\/www.virtuozzo.com\/application-platform-docs\/personal-access-tokens\/05-password-confirmation.png\" alt=\"password confirmation\" \/>\n\n5. Next, you\u2019ll see the access token value. Ensure you\u2019ve saved it (use the\u00a0<strong>Download<\/strong>\/<strong>Copy<\/strong>\u00a0buttons), as it won\u2019t be displayed anywhere ever again.<img decoding=\"async\" src=\"https:\/\/www.virtuozzo.com\/application-platform-docs\/personal-access-tokens\/06-save-access-token.png\" alt=\"save access token\" \/>\n<div class=\"notify-block\">\n<div class=\"center-align\">\n\n<strong>Tip:<\/strong>\u00a0If you forget or lost your token value, it is possible to generate a new one by accessing the\u00a0<strong>Edit Access Token<\/strong>\u00a0frame and clicking the appropriate link at the bottom.<img decoding=\"async\" src=\"https:\/\/www.virtuozzo.com\/application-platform-docs\/personal-access-tokens\/07-regenerate-access-token.png\" alt=\"regenerate access token\" \/>Herewith, the old value becomes invalid, so any existing automation with this token should be updated.\n\n<\/div>\n<\/div>\n6. You can\u00a0<strong>Remove<\/strong>\u00a0no longer required tokens (use\u00a0<strong>Shift<\/strong>\u00a0and\u00a0<strong>Ctrl<\/strong>\u00a0to select multiple ones) with the same-named button at the tools panel.\n\n<img decoding=\"async\" src=\"https:\/\/www.virtuozzo.com\/application-platform-docs\/personal-access-tokens\/08-remove-access-token.png\" alt=\"remove access token\" \/>\n\nConfirm in a pop-up and provide the password to proceed<a id=\"use\"><\/a>. Now, you know how to manage personal access tokens on the account and can use them in your API requests.\n<h3 id=\"use\" class=\"link_owner mt-4\">Using Access Tokens<\/h3>\n\nThe usage of access tokens majorly simplifies API requests authentication, as it allows skipping session generation step and ensures greater reliability compared to the short-term validity of sessions.\n\n1. Just execute the required API method, specifying your\u00a0<em><b>token<\/b><\/em>\u00a0within the\u00a0<em><b>session<\/b><\/em>\u00a0parameter.\n\nFor example, you can\u00a0stop an environment\u00a0by entering the following URL into a browser:\n\n<em>https:\/\/app.<b>${platformDomain}<\/b>\/1.0\/environment\/control\/rest\/stopenv?envName=<strong>${envName}<\/strong>&amp;session=<b>${token}<\/b><\/em>\n\nHere:\n<ul>\n \t<li><em><strong>${platformDomain}<\/strong><\/em>\u00a0&#8211; platform URL (domain name)<\/li>\n \t<li><em><strong>${envName}<\/strong><\/em>\u00a0&#8211; name of the target environment (e.g.\u00a0<em>my-project<\/em>)<\/li>\n \t<li><em><strong>${token}<\/strong><\/em>\u00a0&#8211; value of the token (ensure it has a permission for the called operation)<\/li>\n<\/ul>\n<img decoding=\"async\" src=\"https:\/\/www.virtuozzo.com\/application-platform-docs\/personal-access-tokens\/09-stop-environment-api-request-with-token.png\" alt=\"stop environment api request with token\" \/>For the successful operation, you should get a\u00a0<em>\u201cresult\u201d:0<\/em>\u00a0in response (any non-zero value stands for error).\n\n2. Now, if you return to the dashboard, you\u2019ll see the appropriate environment stopped.<img decoding=\"async\" src=\"https:\/\/www.virtuozzo.com\/application-platform-docs\/personal-access-tokens\/10-stopped-environment.png\" alt=\"stopped environment\" \/>\n<div class=\"mb-4\">That\u2019s it! API management with tokens is that simple!<\/div>\n\n<\/div>\n&nbsp;\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Personal Access Tokens\u00a0are an alternative approach to authenticate API requests in the platform, which, in comparison to the default session-based method, provides greater versatility and reliability.Among advantages of tokens, the following ones can be highlighted: multiple tokens can be generated at once to support different tasks simplified authentication with tokens (no need to perform additional [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":5764,"menu_order":4,"comment_status":"open","ping_status":"closed","template":"","meta":{"_acf_changed":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_links_to":"","_links_to_target":""},"doc_tag":[],"class_list":["post-7201","docs","type-docs","status-publish","hentry","no-post-thumbnail"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/accuweb.cloud\/api\/wp-json\/wp\/v2\/docs\/7201","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/accuweb.cloud\/api\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/accuweb.cloud\/api\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/accuweb.cloud\/api\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/accuweb.cloud\/api\/wp-json\/wp\/v2\/comments?post=7201"}],"version-history":[{"count":25,"href":"https:\/\/accuweb.cloud\/api\/wp-json\/wp\/v2\/docs\/7201\/revisions"}],"predecessor-version":[{"id":7227,"href":"https:\/\/accuweb.cloud\/api\/wp-json\/wp\/v2\/docs\/7201\/revisions\/7227"}],"up":[{"embeddable":true,"href":"https:\/\/accuweb.cloud\/api\/wp-json\/wp\/v2\/docs\/5764"}],"wp:attachment":[{"href":"https:\/\/accuweb.cloud\/api\/wp-json\/wp\/v2\/media?parent=7201"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/accuweb.cloud\/api\/wp-json\/wp\/v2\/doc_tag?post=7201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}