[{"data":1,"prerenderedAt":160},["ShallowReactive",2],{"openapi-specs-catalog":3,"openapi-nav-en-Alternative-API-UN":38,"openapi-doc-\u002FAlternative-API-UN\u002Fauth":123,"openapi-op-\u002FAlternative-API-UN\u002Fauth":159},["Reactive",4],{"defaultLocale":5,"base":6,"specs":7,"specsMeta":11,"locales":35},"en","\u002Fopenapi_docs\u002F",[8,9,10],"Onlinesim-API-UN","Reseller-API-UN","Alternative-API-UN",[12,22,29],{"name":8,"fileName":8,"title":13,"version":14,"description":15,"basePath":16,"specsPath":17,"locales":18,"defaultLocale":5},"Onlinesim API","1.1","This API will allow you to access all services provided by Onlinesim: SMS receiving from a single specific service on a virtual number; rent a number ","Onlinesim-API-UN\u002F","\u002Fopenapi_docs\u002Fspecs\u002FOnlinesim-API-UN",{"en":19,"ru":20,"de":21},"English","Русский","Deutsch",{"name":9,"fileName":9,"title":23,"version":24,"description":25,"basePath":26,"specsPath":27,"locales":28,"defaultLocale":5},"Reseller API","1.0","The API is intended for current and potential Onlinesim partners. It allows you to monetize your numbers by providing them to our customers for receiv","Reseller-API-UN\u002F","\u002Fopenapi_docs\u002Fspecs\u002FReseller-API-UN",{"en":19,"ru":20,"de":21},{"name":10,"fileName":10,"title":30,"version":24,"description":31,"basePath":32,"specsPath":33,"locales":34,"defaultLocale":5},"Alternative API","Alternative API is compatible with the sms-activate protocol: programs written for it work with Onlinesim after changing the address to https:\u002F\u002Fonline","Alternative-API-UN\u002F","\u002Fopenapi_docs\u002Fspecs\u002FAlternative-API-UN",{"en":19,"ru":20,"de":21},[5,36,37],"ru","de",[39,43,48,65,94],{"text":30,"link":40,"icon":41,"description":42},"\u002FAlternative-API-UN\u002Finfo","icons\u002Fdocs\u002Finfo","API overview and introduction",{"text":44,"link":45,"icon":46,"description":47},"Authorization","\u002FAlternative-API-UN\u002Fauth","icons\u002Fdocs\u002Fauth","API keys, OAuth, and security schemes",{"text":49,"collapsed":50,"items":51,"description":63,"icon":64},"profile (alt)",false,[52,58],{"text":53,"link":54,"method":55,"path":56,"description":57,"deprecated":50},"getBalance","\u002FAlternative-API-UN\u002FAlternative-API-UN-get-stubs-handler_api-php-action-getbalance","GET","\u002Fstubs\u002Fhandler_api.php?action=getBalance","Get the balance of the profile",{"text":59,"link":60,"method":55,"path":61,"description":62,"deprecated":50},"getCountries","\u002FAlternative-API-UN\u002FAlternative-API-UN-get-stubs-handler_api-php-action-getcountries","\u002Fstubs\u002Fhandler_api.php?action=getCountries","Get the list of countries","requests related to the user profile or all services provided by Onlinesim","icons\u002Fdocs\u002Ffolder",{"text":66,"collapsed":50,"items":67,"description":93,"icon":64},"single-service activations",[68,73,78,83,88],{"text":69,"link":70,"method":55,"path":71,"description":72,"deprecated":50},"getNumbersStatus","\u002FAlternative-API-UN\u002FAlternative-API-UN-get-stubs-handler_api-php-action-getnumbersstatus","\u002Fstubs\u002Fhandler_api.php?action=getNumbersStatus","Get the number of available numbers by service",{"text":74,"link":75,"method":55,"path":76,"description":77,"deprecated":50},"getNumber","\u002FAlternative-API-UN\u002FAlternative-API-UN-get-stubs-handler_api-php-action-getnumber","\u002Fstubs\u002Fhandler_api.php?action=getNumber","Buy a number for a service",{"text":79,"link":80,"method":55,"path":81,"description":82,"deprecated":50},"getStatus","\u002FAlternative-API-UN\u002FAlternative-API-UN-get-stubs-handler_api-php-action-getstatus","\u002Fstubs\u002Fhandler_api.php?action=getStatus","Get the code from the received SMS",{"text":84,"link":85,"method":55,"path":86,"description":87,"deprecated":50},"getFullSms","\u002FAlternative-API-UN\u002FAlternative-API-UN-get-stubs-handler_api-php-action-getfullsms","\u002Fstubs\u002Fhandler_api.php?action=getFullSms","Get the full text of the received SMS",{"text":89,"link":90,"method":55,"path":91,"description":92,"deprecated":50},"setStatus","\u002FAlternative-API-UN\u002FAlternative-API-UN-get-stubs-handler_api-php-action-setstatus","\u002Fstubs\u002Fhandler_api.php?action=setStatus","Change the operation status","requests for singe-service activations functionality",{"text":95,"collapsed":50,"items":96,"description":122,"icon":64},"rent",[97,102,107,112,117],{"text":98,"link":99,"method":55,"path":100,"description":101,"deprecated":50},"getRentServicesAndCountries","\u002FAlternative-API-UN\u002FAlternative-API-UN-get-stubs-handler_api-php-action-getrentservicesandcountries","\u002Fstubs\u002Fhandler_api.php?action=getRentServicesAndCountries","Get rent countries, free numbers and price",{"text":103,"link":104,"method":55,"path":105,"description":106,"deprecated":50},"getRentNumber","\u002FAlternative-API-UN\u002FAlternative-API-UN-get-stubs-handler_api-php-action-getrentnumber","\u002Fstubs\u002Fhandler_api.php?action=getRentNumber","Rent a number",{"text":108,"link":109,"method":55,"path":110,"description":111,"deprecated":50},"getRentList","\u002FAlternative-API-UN\u002FAlternative-API-UN-get-stubs-handler_api-php-action-getrentlist","\u002Fstubs\u002Fhandler_api.php?action=getRentList","Get your active rentals",{"text":113,"link":114,"method":55,"path":115,"description":116,"deprecated":50},"getRentStatus","\u002FAlternative-API-UN\u002FAlternative-API-UN-get-stubs-handler_api-php-action-getrentstatus","\u002Fstubs\u002Fhandler_api.php?action=getRentStatus","Get the SMS of a rented number",{"text":118,"link":119,"method":55,"path":120,"description":121,"deprecated":50},"setRentStatus","\u002FAlternative-API-UN\u002FAlternative-API-UN-get-stubs-handler_api-php-action-setrentstatus","\u002Fstubs\u002Fhandler_api.php?action=setRentStatus","Close the rent","requests for rent functionality",{"title":44,"kind":124,"locale":5,"specName":10,"path":45,"description":44,"auth":125},"auth",{"api_key":126,"apikey":133,"BearerAuth":138,"OAuth2":144},{"type":127,"description":128,"x-description-ru":129,"x-description-de":130,"name":131,"in":132},"apiKey","\u003Cp>API key is a secret key for a simplified authorization in Onlinesim API.\u003C\u002Fp>\n\u003Chr>\n\u003Ch4>How to get an API key:\u003C\u002Fh4>\n\u003Col>\n  \u003Cli>Log in to personal account, go to the \u003Ca href=\"\u002Fv2\u002Fprofile\u002F\">Profile\u003C\u002Fa> and click on \u003Cstrong>API\u003C\u002Fstrong> tab.\u003C\u002Fli>\n  \u003Cli>Copy the key from the \u003Ccode>API Key\u003C\u002Fcode> field and add it to your application.\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Chr>\n\u003Ch4>How to use it:\u003C\u002Fh4>\n\u003Cp>Send it in the \u003Ccode>api_key\u003C\u002Fcode> query parameter, as sms-activate clients do:\u003C\u002Fp>\n\u003Cpre data-lang=\"text\">\u003Ccode class=\"code-hl code-ln\" style=\"--ln-digits:1\">\u003Cspan class=\"line\">      https:\u002F\u002Fonlinesim.io\u002Fstubs\u002Fhandler_api.php?action=getBalance&amp;api_key={api_key}\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>\u003Ccode>apikey\u003C\u002Fcode> and \u003Ccode>key\u003C\u002Fcode> are accepted as well. A wrong or missing \u003Ccode>api_key\u003C\u002Fcode> gives the text answer \u003Ccode>BAD_KEY\u003C\u002Fcode>.\u003C\u002Fp>","Секретный ключ, используемый для упрощенной авторизации в API Onlinesim.\n\n---\n\n#### Как получить API ключ:\n\n1. Авторизоваться в личном кабинете, перейти в [настройки профиля](https:\u002F\u002Fonlinesim.io\u002Fv2\u002Fprofile\u002F), выбрать вкладку **API**.\n2. Ключ будет указан в строке `API key`. Его необходимо скопировать и добавить в Ваше приложение\u002Fпрограмму.\n\n---\n\n#### Как использовать:\n\nПередавайте его в параметре запроса `api_key`, как это делают клиенты sms-activate:\n\n          https:\u002F\u002Fonlinesim.io\u002Fstubs\u002Fhandler_api.php?action=getBalance&api_key={api_key}\n\n`apikey` и `key` также принимаются. Неверный или отсутствующий `api_key` дает текстовый ответ `BAD_KEY`.","Geheimer Schlüssel, der für die vereinfachte Autorisierung in der Onlinesim API verwendet wird.\n\n---\n\n#### So erhalten Sie einen API-Schlüssel:\n\n1. Melden Sie sich in Ihrem persönlichen Konto an, gehen Sie zu den [Profileinstellungen](https:\u002F\u002Fonlinesim.io\u002Fv2\u002Fprofile\u002F) und wählen Sie die Registerkarte **API**.\n2. Der Schlüssel wird in der Zeile `API key` angezeigt. Sie müssen ihn kopieren und zu Ihrer Anwendung\u002FProgramm hinzufügen.\n\n---\n\n#### So verwenden Sie ihn:\n\nSenden Sie ihn im Abfrageparameter `api_key`, wie es sms-activate-Clients tun:\n\n          https:\u002F\u002Fonlinesim.io\u002Fstubs\u002Fhandler_api.php?action=getBalance&api_key={api_key}\n\n`apikey` und `key` werden ebenfalls akzeptiert. Ein falscher oder fehlender `api_key` ergibt die Textantwort `BAD_KEY`.","api_key","query",{"type":127,"description":134,"x-description-ru":135,"x-description-de":136,"name":137,"in":132},"\u003Cp>The same API key in the \u003Ccode>apikey\u003C\u002Fcode> (or \u003Ccode>key\u003C\u002Fcode>) query parameter, as in the Onlinesim API. \u003Ccode>api_key\u003C\u002Fcode> takes\nprecedence when both are sent. A wrong key here is rejected with HTTP \u003Ccode>456\u003C\u002Fcode> and \u003Ccode>{\"response\":\"ERROR_WRONG_KEY\"}\u003C\u002Fcode>.\u003C\u002Fp>","Тот же API ключ в параметре запроса `apikey` (или `key`), как в API Onlinesim. Если переданы оба, приоритет у\n`api_key`. Неверный ключ здесь отклоняется с HTTP `456` и `{\"response\":\"ERROR_WRONG_KEY\"}`.","Derselbe API-Schlüssel im Abfrageparameter `apikey` (oder `key`), wie in der Onlinesim API. Werden beide gesendet,\nhat `api_key` Vorrang. Ein falscher Schlüssel wird hier mit HTTP `456` und `{\"response\":\"ERROR_WRONG_KEY\"}` abgelehnt.","apikey",{"type":139,"description":140,"x-description-ru":141,"x-description-de":142,"scheme":143},"http","\u003Cp>The API key can also be used for authorization in the request header using the \u003Ccode>Authorization: Bearer\u003C\u002Fcode> scheme, for example:\u003C\u002Fp>\n\u003Cpre data-lang=\"http\">\u003Ccode class=\"code-hl code-ln\" style=\"--ln-digits:1\">\u003Cspan class=\"line\">\u003Cspan class=\"tok-key\">Authorization\u003C\u002Fspan>\u003Cspan class=\"tok-punct\">:\u003C\u002Fspan> Bearer \u003Cspan class=\"tok-punct\">{\u003C\u002Fspan>api_key\u003Cspan class=\"tok-punct\">}\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan class=\"tok-key\">User-Agent\u003C\u002Fspan>\u003Cspan class=\"tok-punct\">:\u003C\u002Fspan> PostmanRuntime\u003Cspan class=\"tok-punct\">\u002F\u003C\u002Fspan>\u003Cspan class=\"tok-number\">7.29\u003C\u002Fspan>\u003Cspan class=\"tok-punct\">.\u003C\u002Fspan>\u003Cspan class=\"tok-number\">2\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan class=\"tok-key\">Accept\u003C\u002Fspan>\u003Cspan class=\"tok-punct\">:\u003C\u002Fspan> \u003Cspan class=\"tok-punct\">*\u002F\\*\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan class=\"tok-key\">Cache-Control\u003C\u002Fspan>\u003Cspan class=\"tok-punct\">:\u003C\u002Fspan> no\u003Cspan class=\"tok-punct\">-\u003C\u002Fspan>cache\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan class=\"tok-key\">Postman-Token\u003C\u002Fspan>\u003Cspan class=\"tok-punct\">:\u003C\u002Fspan> \u003Cspan class=\"tok-number\">948\u003C\u002Fspan>bc880\u003Cspan class=\"tok-number\">-8\u003C\u002Fspan>d25\u003Cspan class=\"tok-number\">-4298\u003C\u002Fspan>\u003Cspan class=\"tok-number\">-994\u003C\u002Fspan>f\u003Cspan class=\"tok-punct\">-\u003C\u002Fspan>fe6e22ada339\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan class=\"tok-key\">Host\u003C\u002Fspan>\u003Cspan class=\"tok-punct\">:\u003C\u002Fspan> onlinesim\u003Cspan class=\"tok-punct\">.\u003C\u002Fspan>io\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan class=\"tok-key\">Accept-Encoding\u003C\u002Fspan>\u003Cspan class=\"tok-punct\">:\u003C\u002Fspan> gzip\u003Cspan class=\"tok-punct\">,\u003C\u002Fspan> deflate\u003Cspan class=\"tok-punct\">,\u003C\u002Fspan> br\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan class=\"tok-key\">Connection\u003C\u002Fspan>\u003Cspan class=\"tok-punct\">:\u003C\u002Fspan> keep\u003Cspan class=\"tok-punct\">-\u003C\u002Fspan>alive\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan class=\"tok-key\">Cookie\u003C\u002Fspan>\u003Cspan class=\"tok-punct\">:\u003C\u002Fspan> xxxx\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003Caside class=\"my-4 rounded-lg border p-4 text-sm leading-relaxed not-prose border-brand-200 bg-brand-50 text-brand-950 theme-dark:text-gray-800\" role=\"note\">\u003Cdiv class=\"openapi-callout-body [&amp;_p:last-child]:mb-0 [&amp;_p]:mb-2\">\u003Cp>Using an API key provides a simplified way to authorize requests. We recommend using OAuth 2.0 for more secure data handling.\u003C\u002Fp>\n\u003Cp>For detailed information, please refer to the official \u003Ca href=\"https:\u002F\u002Foauth.net\u002F2\u002F\" target=\"_blank\" rel=\"noopener noreferrer\">OAuth 2.0 documentation\u003C\u002Fa>.\u003C\u002Fp>\n\u003C\u002Fdiv>\u003C\u002Faside>","API ключ также можно использовать для авторизации в заголовке запроса, используя схему `Authorization: Bearer`, например:\n\n```bash\nAuthorization: Bearer {api_key}\nUser-Agent: PostmanRuntime\u002F7.29.2\nAccept: *\u002F\\*\nCache-Control: no-cache\nPostman-Token: 948bc880-8d25-4298-994f-fe6e22ada339\nHost: onlinesim.io\nAccept-Encoding: gzip, deflate, br\nConnection: keep-alive\nCookie: xxxx\n```\n\n::: tip\nИспользование API ключа представляет собой способ для упрощенной авторизации запросов. Мы рекомендуем использовать OAuth 2.0 для более безопасной работы с данными.\n\nДля получения более подробной информации, пожалуйста, обратитесь к [официальной документации OAuth 2.0](https:\u002F\u002Foauth.net\u002F2\u002F).\n:::\n","Der API-Schlüssel kann auch für die Autorisierung im Anfrageheader verwendet werden, indem das Schema `Authorization: Bearer` verwendet wird, z. B.:\n\n```bash\nAuthorization: Bearer {api_key}\nUser-Agent: PostmanRuntime\u002F7.29.2\nAccept: *\u002F\\*\nCache-Control: no-cache\nPostman-Token: 948bc880-8d25-4298-994f-fe6e22ada339\nHost: onlinesim.io\nAccept-Encoding: gzip, deflate, br\nConnection: keep-alive\nCookie: xxxx\n```\n\n::: tip        \nDie Verwendung eines API-Schlüssels ist eine Methode zur vereinfachten Autorisierung von Anfragen. Wir empfehlen die Verwendung von OAuth 2.0 für eine sicherere Arbeit mit Daten.\n\nFür weitere Informationen wenden Sie sich bitte an die [offizielle OAuth 2.0-Dokumentation](https:\u002F\u002Foauth.net\u002F2\u002F).\n:::\n","bearer",{"type":145,"description":146,"x-description-ru":147,"x-description-de":148,"flows":149},"oauth2","\u003Cp>\u003Cspan id=\"OAUTH\">\u003C\u002Fspan>\u003C\u002Fp>\n\u003Ch3>OAuth 2.0\u003C\u002Fh3>\n\u003Cp>The OAuth 2.0 authorization protocol provides several authorization scenarios, in our case Authorization Code and Implicit Flow types are available.\u003C\u002Fp>\n\u003Caside class=\"my-4 rounded-lg border p-4 text-sm leading-relaxed not-prose border-brand-200 bg-brand-50 text-brand-950 theme-dark:text-gray-800\" role=\"note\">\u003Cdiv class=\"openapi-callout-body [&amp;_p:last-child]:mb-0 [&amp;_p]:mb-2\">For detailed information, please refer to the official \u003Ca href=\"https:\u002F\u002Foauth.net\u002F2\u002F\" target=\"_blank\" rel=\"noopener noreferrer\">OAuth 2.0 documentation\u003C\u002Fa>.\u003C\u002Fdiv>\u003C\u002Faside>\u003Cp>\u003Cstrong>Authorization URL\u003C\u002Fstrong>: \u003Ccode>https:\u002F\u002Fonlinesim.io\u002Foauth\u002Fauthorize\u003C\u002Fcode>\u003C\u002Fp>\n\u003Cp>\u003Cstrong>Token URL\u003C\u002Fstrong>: \u003Ccode>https:\u002F\u002Fonlinesim.io\u002Foauth\u002Ftoken\u003C\u002Fcode>\u003C\u002Fp>\n\u003Cp>\u003Cstrong>Scopes\u003C\u002Fstrong>:\u003C\u002Fp>\n\u003Cul>\n  \u003Cli>\u003Ccode>sms-scope\u003C\u002Fcode> grants access to manage numbers for the SMS receiving service from Onlinesim;\u003C\u002Fli>\n  \u003Cli>\u003Ccode>rent-scope\u003C\u002Fcode> grants access to renting phone numbers from Onlinesim;\u003C\u002Fli>\n  \u003Cli>\u003Ccode>free-scope\u003C\u002Fcode> grants access to using Onlinesim's free numbers.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch3>\u003Cstrong>Register the app in our authorization service\u003C\u002Fstrong>\u003C\u002Fh3>\n\u003Col>\n  \u003Cli>Open \u003Ca href=\"\u002Foauth\">OAuth\u003C\u002Fa> page\u003C\u002Fli>\n  \u003Cli>\n    \u003Cp>Add your app by clicking \"Create New Client\", then fill the fields below:\u003C\u002Fp>\n    \u003Cul>\n      \u003Cli>\u003Ccode>Name\u003C\u002Fcode> - could be the app name or any other name you and your users will associate with the app;\u003C\u002Fli>\n      \u003Cli>\u003Ccode>Redirect URL\u003C\u002Fcode> - after user authorization on our server, the client will be redirected with authorization code to this URL.\u003C\u002Fli>\n      \u003Cli>\n        \u003Ccode>Confidential\u003C\u002Fcode> - (optional), mark the client as \u003Cu>Confidential\u003C\u002Fu> if your application runs on a server and can securely store the \u003Cu>Client Secret\u003C\u002Fu>.\n      \u003C\u002Fli>\n    \u003C\u002Ful>\n  \u003C\u002Fli>\n\u003C\u002Fol>\n\u003Cp>\u003Cimg src=\"\u002Fopenapi_docs\u002Fdocs\u002FCreateOAuthClient.png\" alt=\"Client creation\">\u003C\u002Fp>\n\u003Col start=\"3\">\n  \u003Cli>Click \"Create\". New client will appear in the list of applications.\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Cp>\u003Cimg src=\"\u002Fopenapi_docs\u002Fdocs\u002FOAuthClient.png\" alt=\"Client list\">\u003C\u002Fp>\n\u003Col start=\"4\">\n  \u003Cli>Save the \u003Ccode>Client ID\u003C\u002Fcode> and \u003Ccode>Secret\u003C\u002Fcode> in a secure location; they will be used by your application for authorization.\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Cp>\u003Cspan id=\"AUTHCODE\">\u003C\u002Fspan>\u003C\u002Fp>\n\u003Ch3>OAuth 2.0. Authorization code flow\u003C\u002Fh3>\n\u003Ch4>\u003Cstrong>Authorize a user and get a token\u003C\u002Fstrong>\u003C\u002Fh4>\n\u003Col>\n  \u003Cli>Authorize a client with a GET request to \u003Ccode>https:\u002F\u002Fonlinesim.io\u002Foauth\u002Fauthorize\u003C\u002Fcode> with parameters \u003Ccode>client_id\u003C\u002Fcode>, \u003Ccode>redirect_uri\u003C\u002Fcode>, \u003Ccode>response_type\u003C\u002Fcode>, \u003Ccode>scope\u003C\u002Fcode>, \u003Ccode>state\u003C\u002Fcode>:\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Ch5>Parameter Description\u003C\u002Fh5>\n\u003Ctable>\n  \u003Cthead>\n    \u003Ctr>\n      \u003Cth>Parameter Name\u003C\u002Fth>\n      \u003Cth style=\"text-align:center\">Data Type\u003C\u002Fth>\n      \u003Cth>Description\u003C\u002Fth>\n    \u003C\u002Ftr>\n  \u003C\u002Fthead>\n  \u003Ctbody>\n    \u003Ctr>\n      \u003Ctd>client_id\u003C\u002Ftd>\n      \u003Ctd style=\"text-align:center\">STRING\u003C\u002Ftd>\n      \u003Ctd>\u003Ccode>Client ID\u003C\u002Fcode> (returned when the app registration process is complete)\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>redirect_uri\u003C\u002Ftd>\n      \u003Ctd style=\"text-align:center\">STRING\u003C\u002Ftd>\n      \u003Ctd>Redirect destination for the client after a successful authorization, it must match the value of \u003Ccode>Redirect URL\u003C\u002Fcode> field you've set during app registration process.\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>response_type\u003C\u002Ftd>\n      \u003Ctd style=\"text-align:center\">STRING\u003C\u002Ftd>\n      \u003Ctd>Use \u003Ccode>code\u003C\u002Fcode> as a value for Authorization code flow\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>scope\u003C\u002Ftd>\n      \u003Ctd style=\"text-align:center\">STRING\u003C\u002Ftd>\n      \u003Ctd>Access rights that your app asks from the user. Possible values: \u003Ccode>sms-scope\u003C\u002Fcode>, \u003Ccode>rent-scope\u003C\u002Fcode>, \u003Ccode>free-scope\u003C\u002Fcode>. You can specify multiple values\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>state\u003C\u002Ftd>\n      \u003Ctd style=\"text-align:center\">STRING\u003C\u002Ftd>\n      \u003Ctd>A random string for CSRF protection (verify it after the redirect)\u003C\u002Ftd>\n    \u003C\u002Ftr>\n  \u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Col start=\"2\">\n  \u003Cli>After the request to \u003Ccode>https:\u002F\u002Fonlinesim.io\u002Foauth\u002Fauthorize\u003C\u002Fcode> is sent, the user from your app will be redirected to the authorization page to enter the login and password. If successful, authorize your app to work with user data in the Onlinesim service. To do so, he has to click on the \u003Cem>\u003Ccode>Authorize\u003C\u002Fcode>\u003C\u002Fem> button:\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Cp>\u003Cimg src=\"\u002Fopenapi_docs\u002Fdocs\u002FOAuthRequest.png\" alt=\"OAuth request\">\u003C\u002Fp>\n\u003Caside class=\"my-4 rounded-lg border p-4 text-sm leading-relaxed not-prose border-brand-200 bg-brand-50 text-brand-950 theme-dark:text-gray-800\" role=\"note\">\u003Cdiv class=\"openapi-callout-body [&amp;_p:last-child]:mb-0 [&amp;_p]:mb-2\">At this point, you can check the \u003Ccode>state\u003C\u002Fcode>\n parameter, to confirm secure communication with the authorization service\u003C\u002Fdiv>\u003C\u002Faside>\u003Col start=\"3\">\n  \u003Cli>If the authorization is successful, the user will be redirected to \u003Ccode>redirect_uri\u003C\u002Fcode> with the parameter \u003Ccode>code\u003C\u002Fcode>. Now you can get the \u003Ccode>access token\u003C\u002Fcode> after making a POST request to \u003Ccode>https:\u002F\u002Fonlinesim.io\u002Foauth\u002Ftoken\u003C\u002Fcode>:\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Ch5>Parameter Description\u003C\u002Fh5>\n\u003Ctable>\n  \u003Cthead>\n    \u003Ctr>\n      \u003Cth>Parameter name\u003C\u002Fth>\n      \u003Cth style=\"text-align:center\">Data type\u003C\u002Fth>\n      \u003Cth>Description\u003C\u002Fth>\n    \u003C\u002Ftr>\n  \u003C\u002Fthead>\n  \u003Ctbody>\n    \u003Ctr>\n      \u003Ctd>grant_type\u003C\u002Ftd>\n      \u003Ctd style=\"text-align:center\">STRING\u003C\u002Ftd>\n      \u003Ctd>Authorization scenario type, use \u003Ccode>authorization_code\u003C\u002Fcode> when using the Authorization Code flow.\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>client_id\u003C\u002Ftd>\n      \u003Ctd style=\"text-align:center\">STRING\u003C\u002Ftd>\n      \u003Ctd>\u003Ccode>Client ID\u003C\u002Fcode> (returned when the app registration process is complete)\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>client_secret\u003C\u002Ftd>\n      \u003Ctd style=\"text-align:center\">STRING\u003C\u002Ftd>\n      \u003Ctd>\u003Ccode>Client_secret\u003C\u002Fcode> (returned when the app registration process is complete)\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>redirect_uri\u003C\u002Ftd>\n      \u003Ctd style=\"text-align:center\">STRING\u003C\u002Ftd>\n      \u003Ctd>Redirect URL for the client after a successful authorization, it must match the \u003Ccode>Redirect URL\u003C\u002Fcode> parameter used during app registration process.\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>code\u003C\u002Ftd>\n      \u003Ctd style=\"text-align:center\">STRING\u003C\u002Ftd>\n      \u003Ctd>Authorization code, obtained in the previous step\u003C\u002Ftd>\n    \u003C\u002Ftr>\n  \u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Caside class=\"my-4 rounded-lg border p-4 text-sm leading-relaxed not-prose border-red-200 bg-red-50 text-red-950 theme-dark:text-red-800\" role=\"note\">\u003Cdiv class=\"openapi-callout-body [&amp;_p:last-child]:mb-0 [&amp;_p]:mb-2\">Since \u003Ccode>client_secret\u003C\u002Fcode>\n is a private key, it is not recommended to store it in the frontend of the client. For better security, you should store it in the backend of your app. To implement the Authorization Code scenario, you need to pass this code from the frontend to the backend of your service.\u003C\u002Fdiv>\u003C\u002Faside>\u003Col start=\"4\">\n  \u003Cli>As a result of a successful request to \u003Ccode>https:\u002F\u002Fonlinesim.io\u002Foauth\u002Ftoken\u003C\u002Fcode>, you get JSON in response, which contains \u003Ccode>access_token\u003C\u002Fcode>, \u003Ccode>refresh_token\u003C\u002Fcode>, and \u003Ccode>expires_in\u003C\u002Fcode> attributes. The \u003Ccode>expires_in\u003C\u002Fcode> attribute contains the number of seconds before the access token is expired and the \u003Ccode>refresh_token\u003C\u002Fcode> is used to renew the access token when it expires.\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Chr>\n\u003Ch4>\u003Cstrong>Authorization and token refreshment\u003C\u002Fstrong>\u003C\u002Fh4>\n\u003Cp>For all API requests, add the \u003Cstrong>Authorization: Bearer \u003Cem>\u003Ccode>access_token\u003C\u002Fcode>\u003C\u002Fem>\u003C\u002Fstrong> header.\nIf your request results in \u003Ccode>ERROR_WRONG_KEY\u003C\u002Fcode>, you need to refresh your token or get a new one.\u003C\u002Fp>\n\u003Cpre data-lang=\"json\">\u003Ccode class=\"code-hl code-ln\" style=\"--ln-digits:1\">\u003Cspan class=\"line\">\u003Cspan class=\"tok-punct\">{\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">  \u003Cspan class=\"tok-key\">&quot;response&quot;\u003C\u002Fspan>\u003Cspan class=\"tok-punct\">:\u003C\u002Fspan> \u003Cspan class=\"tok-string\">&quot;ERROR_WRONG_KEY&quot;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan class=\"tok-punct\">}\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>To refresh the token you must make a POST request to \u003Ccode>https:\u002F\u002Fonlinesim.io\u002Foauth\u002Ftoken\u003C\u002Fcode> with the parameters \u003Ccode>grant_type\u003C\u002Fcode>, \u003Ccode>client_id\u003C\u002Fcode>, \u003Ccode>client_secret\u003C\u002Fcode>, and \u003Ccode>refresh_token\u003C\u002Fcode>. For the \u003Ccode>refresh_token\u003C\u002Fcode> field, use the value obtained in step 4.\u003C\u002Fp>\n\u003Ch5>Parameter Description\u003C\u002Fh5>\n\u003Ctable>\n  \u003Cthead>\n    \u003Ctr>\n      \u003Cth>Parameter name\u003C\u002Fth>\n      \u003Cth style=\"text-align:center\">Data type\u003C\u002Fth>\n      \u003Cth>Description\u003C\u002Fth>\n    \u003C\u002Ftr>\n  \u003C\u002Fthead>\n  \u003Ctbody>\n    \u003Ctr>\n      \u003Ctd>grant_type\u003C\u002Ftd>\n      \u003Ctd style=\"text-align:center\">STRING\u003C\u002Ftd>\n      \u003Ctd>Use \u003Ccode>refresh_token\u003C\u002Fcode> as a value\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>client_id\u003C\u002Ftd>\n      \u003Ctd style=\"text-align:center\">STRING\u003C\u002Ftd>\n      \u003Ctd>\u003Ccode>Client ID\u003C\u002Fcode> (returned when the app registration process is complete)\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>client_secret\u003C\u002Ftd>\n      \u003Ctd style=\"text-align:center\">STRING\u003C\u002Ftd>\n      \u003Ctd>\u003Ccode>Client_secret\u003C\u002Fcode> (returned when the app registration process is complete)\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>refresh_token\u003C\u002Ftd>\n      \u003Ctd style=\"text-align:center\">STRING\u003C\u002Ftd>\n      \u003Ctd>\u003Ccode>Refresh_token\u003C\u002Fcode> is obtained along with the \u003Ccode>access_token\u003C\u002Fcode>. It has a much longer lifetime and is used to refresh \u003Ccode>access_token\u003C\u002Fcode>\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>code\u003C\u002Ftd>\n      \u003Ctd style=\"text-align:center\">STRING\u003C\u002Ftd>\n      \u003Ctd>Authorization code, obtained in the previous step\u003C\u002Ftd>\n    \u003C\u002Ftr>\n  \u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cp>\u003Cspan id=\"IMPLICIT\">\u003C\u002Fspan>\u003C\u002Fp>\n\u003Ch3>OAuth 2.0. Implicit flow\u003C\u002Fh3>\n\u003Ch4>\u003Cstrong>Authorize a user and get a token\u003C\u002Fstrong>\u003C\u002Fh4>\n\u003Col>\n  \u003Cli>Authorize a client with a GET request to the endpoint \u003Ccode>https:\u002F\u002Fonlinesim.io\u002Foauth\u002Fauthorize\u003C\u002Fcode> with parameters \u003Ccode>client_id\u003C\u002Fcode>, \u003Ccode>redirect_uri\u003C\u002Fcode>, \u003Ccode>response_type\u003C\u002Fcode>, \u003Ccode>scope\u003C\u002Fcode>, \u003Ccode>state\u003C\u002Fcode>:\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Ch5>Parameter Description\u003C\u002Fh5>\n\u003Ctable>\n  \u003Cthead>\n    \u003Ctr>\n      \u003Cth>Parameter name\u003C\u002Fth>\n      \u003Cth style=\"text-align:center\">Data type\u003C\u002Fth>\n      \u003Cth>Description\u003C\u002Fth>\n    \u003C\u002Ftr>\n  \u003C\u002Fthead>\n  \u003Ctbody>\n    \u003Ctr>\n      \u003Ctd>client_id\u003C\u002Ftd>\n      \u003Ctd style=\"text-align:center\">STRING\u003C\u002Ftd>\n      \u003Ctd>\u003Ccode>Client ID\u003C\u002Fcode> (returned when the app registration process is complete)\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>redirect_uri\u003C\u002Ftd>\n      \u003Ctd style=\"text-align:center\">STRING\u003C\u002Ftd>\n      \u003Ctd>Redirect destination for the client after a successful authorization, it must match the \u003Ccode>Redirect URL\u003C\u002Fcode> parameter used during app registration process.\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>response_type\u003C\u002Ftd>\n      \u003Ctd style=\"text-align:center\">STRING\u003C\u002Ftd>\n      \u003Ctd>Use \u003Ccode>token\u003C\u002Fcode> as a value for Implicit flow\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>scope\u003C\u002Ftd>\n      \u003Ctd style=\"text-align:center\">STRING\u003C\u002Ftd>\n      \u003Ctd>Access rights that your app asks from the user. Possible values: \u003Ccode>sms-scope\u003C\u002Fcode>, \u003Ccode>rent-scope\u003C\u002Fcode>, \u003Ccode>free-scope\u003C\u002Fcode>. You can specify multiple values\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>state\u003C\u002Ftd>\n      \u003Ctd style=\"text-align:center\">STRING\u003C\u002Ftd>\n      \u003Ctd>A random string for CSRF protection (verify it after the redirect)\u003C\u002Ftd>\n    \u003C\u002Ftr>\n  \u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Col start=\"2\">\n  \u003Cli>After the request to \u003Ccode>https:\u002F\u002Fonlinesim.io\u002Foauth\u002Fauthorize\u003C\u002Fcode> is sent, the user will be redirected from your app to the authorization page to enter the login &amp; password and, if successful, authorize your app to work with user data in the Onlinesim service. To do so, he has to click on \u003Cem>\u003Ccode>Authorize\u003C\u002Fcode>\u003C\u002Fem> button:\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Cp>\u003Cimg src=\"\u002Fopenapi_docs\u002Fdocs\u002FOAuthRequest.png\" alt=\"OAuth request\">\u003C\u002Fp>\n\u003Caside class=\"my-4 rounded-lg border p-4 text-sm leading-relaxed not-prose border-brand-200 bg-brand-50 text-brand-950 theme-dark:text-gray-800\" role=\"note\">\u003Cdiv class=\"openapi-callout-body [&amp;_p:last-child]:mb-0 [&amp;_p]:mb-2\">At this point, you can check the \u003Ccode>state\u003C\u002Fcode>\n parameter, to confirm secure communication with the authorization service\u003C\u002Fdiv>\u003C\u002Faside>\u003Col start=\"3\">\n  \u003Cli>In case of successful authorization, the user will be redirected to the \u003Ccode>redirect_uri\u003C\u002Fcode> address with the parameter \u003Ccode>access_token\u003C\u002Fcode>. This token is required for authorization in Onlinesim API.\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Chr>\n\u003Ch3>\u003Cstrong>Authorization of requests to the Onlinesim API\u003C\u002Fstrong>\u003C\u002Fh3>\n\u003Cp>Add to all API requests \u003Cstrong>Authorization: Bearer \u003Cem>\u003Ccode>access_token\u003C\u002Fcode>\u003C\u002Fem>\u003C\u002Fstrong> header.\nIf your request results in \u003Ccode>ERROR_WRONG_KEY\u003C\u002Fcode>, you should get a new token.\u003C\u002Fp>\n\u003Cpre data-lang=\"json\">\u003Ccode class=\"code-hl code-ln\" style=\"--ln-digits:1\">\u003Cspan class=\"line\">\u003Cspan class=\"tok-punct\">{\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">  \u003Cspan class=\"tok-key\">&quot;response&quot;\u003C\u002Fspan>\u003Cspan class=\"tok-punct\">:\u003C\u002Fspan> \u003Cspan class=\"tok-string\">&quot;ERROR_WRONG_KEY&quot;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan class=\"tok-punct\">}\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>","\n\u003Cspan id=\"OAUTH\">\u003C\u002Fspan>\n### OAuth 2.0\nПротокол OAuth 2.0 поддерживает несколько сценариев авторизации, для работы с нашим API можно использовать сценарии Authorization Code Flow или Implicit Flow.\n\n::: info\nДля получения более подробной информации, пожалуйста, обратитесь к [официальной документации OAuth 2.0](https:\u002F\u002Foauth.net\u002F2\u002F).\n:::\n\n**Authorization URL**: `https:\u002F\u002Fonlinesim.io\u002Foauth\u002Fauthorize`\n\n**Token URL**: `https:\u002F\u002Fonlinesim.io\u002Foauth\u002Ftoken`\n\n**Scopes**:\n\n  - `sms-scope` открывает доступ к управлению номерами для услуги \"Прием SMS\" от Onlinesim;\n  \n  - `rent-scope` открывает доступ к аренде виртуальных телефонных номеров Onlinesim;\n  \n  - `free-scope` открывает доступ к использованию бесплатных номеров Onlinesim.\n\n### **Регистрация вашего приложения на нашем сервисе авторизации**\n\n1. Перейдите на [страницу OAuth](https:\u002F\u002Fonlinesim.io\u002Foauth)\n2. Создайте новый клиент, указав:\n      * `Name` - название приложения или любое другое название, которое Вы и Ваши пользователи будут ассоциировать с приложением;\n      * `Redirect URL` - URL, на который будет перенаправлен клиент после авторизации и куда будет направлен код авторизации приложения;\n      * `Confidential` - необзятально, отметье клиент как \u003Cu>Confidential\u003C\u002Fu>, если ваше приложение работает на сервере и может безопасно хранить \u003Cu>Client Secret\u003C\u002Fu>.\n\n![Создание клиента](\u002Fdocs\u002FCreateOAuthClient.png)\n\n3. Нажмите \"Create\". Добавленное Вами приложение будет отображаться в списке клиентов.\n\n![Список клиентов](\u002Fdocs\u002FOAuthClient.png)\n\n4. Сохраните `Client ID` и `Secret` в безопасном месте, далее они будут использоваться Вашим приложении для авторизации.\n\n\u003Cspan id=\"AUTHCODE\">\u003C\u002Fspan>\n### OAuth 2.0. Authorization Сode Flow\n\n#### **Авторизация пользователя и получение токена**\n\n1. Авторизуйте клиент через GET запрос к `https:\u002F\u002Fonlinesim.io\u002Foauth\u002Fauthorize` с параметрами `client_id`, `redirect_uri`, `response_type`, `scope`, `state`:\n\n##### Описание параметров\n\n  Название параметра | Тип данных | Описание\n  -------------------|:----------:|---------\n  client_id | STRING | `Client ID`, который был получен после регистрации приложения\n  redirect_uri | STRING | Адрес на который будет перенаправлен клиент, после успешной авторизации, должен совпадать с `Redirect URL`, который Вы указали при регистрации приложения.\n  response_type | STRING | Указать `code`\n  scope | STRING | Права доступа, разрешение на которые запрашивает Ваше приложение у пользователя. Возможные варианты: `sms-scope`, `rent-scope`, `free-scope`. Можно указать несколько значений\n  state | STRING | Случайная строка для защиты от CSRF (проверьте её после редиректа)\n\n2. После запроса к `https:\u002F\u002Fonlinesim.io\u002Foauth\u002Fauthorize` пользователь из Вашего приложения будет перенаправлен на страницу авторизации, где ему необходимо указать логин пароль и, в случае успеха, авторизовать Ваше приложение для работы с данными пользователя в сервисе Onlinesim. Для этого ему необходимо будет нажать кнопку *`Authorize`*:\n\n![OAuth запрос](\u002Fdocs\u002FOAuthRequest.png)\n\n::: info\nНа этом этапе Вы можете проверить параметр `state`, для подтверждения безопасного взаимодействия с сервисом авторизации\n:::\n\n3. В случае успешной авторизации пользователь будет перенаправлен по адресу `redirect_uri` с параметром `code`. Теперь Вы можете получить `access token`, для этого необходимо сделать POST запрос к `https:\u002F\u002Fonlinesim.io\u002Foauth\u002Ftoken`:\n\n##### Описание параметров\n\n  Название параметра | Тип данных | Описание\n  ---------|:--------:|---------\n  grant_type | STRING | Сценарий авторизации, для сценария Authorization Сode необходимо указать `authorization_code`\n  client_id | STRING | `Client ID`, который был получен после регистрации приложения\n  client_secret | STRING |`Сlient_secret`, который был получен после регистрации приложения\n  redirect_uri | STRING | Адрес на который будет перенаправлен клиент, после успешной авторизации, должен совпадать с `Redirect URL`, который Вы указали при регистрации приложения\n  code | STRING | Код авторизации, который был получен на предыдущем этапе\n\n::: danger\n\nТак как `client_secret` -  это приватный ключ, крайне не рекомендуется хранить его на frontend клиента. Для большей безопасности необходимо хранить его в бэкенде Вашего приложения. Для реализации сценария с авторизационным кодом нужно передать полученный frontend'ем код в backend Вашего сервиса, а уже он должен обратится в авторизационный сервис для получения токена.\n:::\n\n4. В результате успешного выполнения запроса к `https:\u002F\u002Fonlinesim.io\u002Foauth\u002Ftoken`, в ответ получите JSON, содержащий поля `access_token`, `refresh_token` и `expires_in`. Поле `expires_in` определяет количество секунд до истечения срока действия токена доступа, `refresh_token` используется для обновления токена доступа при истечении его срока действия.\n\n---\n\n#### **Авторизация запросов к API Onlinesim и обновление токена**\n\nВо все запросы к API нужно добавлять заголовок **Authorization: Bearer *`access_token`***.\nЕсли в ответ на ваш запрос пришел `ERROR_WRONG_KEY`, Вам необходимо обновить токен или получить новый.\n\n  ```json\n  {\n    \"response\": \"ERROR_WRONG_KEY\"\n  }\n  ```\n\nДля обновления токена необходимо сделать POST запрос к `https:\u002F\u002Fonlinesim.io\u002Foauth\u002Ftoken` с параметрами `grant_type`, `client_id`, `client_secret` и `refresh_token`. Для поля `refresh_token` необходимо использовать значение, которое было получено в шаге 4.\n\n##### Описание параметров\n\n  Название параметра | Тип данных | Описание\n  ---------|:--------:|---------\n  grant_type | STRING | Необходимо указать `refresh_token`\n  client_id | STRING | `client ID`, который Вы получили при регистрации приложения\n  client_secret | STRING | `client_secret`, который был получен при регистрации приложения\n  refresh_token | STRING | `refresh_token` был получен вместе с `access_token`. Имеет гораздо большее время жизни и используется для обновления `access_token`\n\n\n\u003Cspan id=\"IMPLICIT\">\u003C\u002Fspan>\n### OAuth 2.0. Implicit flow\n\n#### **Авторизация пользователя и получение токена**\n1. Авторизуйте клиент через GET запрос к `https:\u002F\u002Fonlinesim.io\u002Foauth\u002Fauthorize` с параметрами `client_id`, `redirect_uri`, `response_type`, `scope`, `state`:\n\n##### Описание параметров\n\n  Название параметра | Тип данных | Описание\n  ---------|:--------:|---------\n  client_id | STRING | `Client ID`, который был получен при регистрации приложения\n  redirect_uri | STRING | Адрес на который будет перенаправлен клиент, после успешной авторизации, должен совпадать с `Redirect URL`, который Вы указали при добавлении приложения.\n  response_type | STRING | Используйте `token` в качестве значения\n  scope | STRING | Права доступа, разрешение на которые запрашивает Ваше приложение у пользователя. Возможные варианты: `sms-scope`, `rent-scope`, `free-scope`. Можно указать несколько значений\n  state | STRING | Случайная строка для защиты от CSRF (проверьте её после редиректа)\n\n2. После запроса к `https:\u002F\u002Fonlinesim.io\u002Foauth\u002Fauthorize`, пользователь из Вашего приложения будет перенаправлен на страницу авторизации, где ему необходимо указать логин пароль и, в случае успеха, авторизовать Ваше приложение для работы с данными пользователя в сервисе Onlinesim. Для этого ему необходимо будет нажать кнопку *`Authorize`*:\n\n![OAuth запрос](\u002Fdocs\u002FOAuthRequest.png)\n\n::: info\nНа этом этапе Вы можете проверить параметр `state`, для подтверждения безопасного взаимодействия с сервисом авторизации\n:::\n\n3. В случае успешной авторизации пользователь будет перенаправлен по адрес `redirect_uri` с параметром `access_token`. Это и есть необходимый токен для авторизации в API Onlinesim.\n\n---\n\n### **Авторизация запросов к API Onlinesim**\n\nВо все запросы к API нужно добавлять заголовок **Authorization: Bearer *`access_token`***.\nЕсли в ответ на ваш запрос пришел `ERROR_WRONG_KEY`, Вам необходимо получить новый токен.\n\n  ```json\n  {\n    \"response\": \"ERROR_WRONG_KEY\"\n  }\n  ```\n","\n\u003Cspan id=\"OAUTH\">\u003C\u002Fspan>\n### OAuth 2.0\nDas OAuth 2.0-Protokoll unterstützt mehrere Autorisierungsszenarien. Für die Arbeit mit unserer API können Sie die Szenarien Authorization Code Flow oder Implicit Flow verwenden.\n\n::: info\nFür weitere Informationen wenden Sie sich bitte an die [offizielle OAuth 2.0-Dokumentation](https:\u002F\u002Foauth.net\u002F2\u002F).\n:::\n\n**Authorization URL**: `https:\u002F\u002Fonlinesim.io\u002Foauth\u002Fauthorize`\n\n**Token URL**: `https:\u002F\u002Fonlinesim.io\u002Foauth\u002Ftoken`\n\n**Scopes**:\n\n  - `sms-scope` gewährt Zugriff auf die Verwaltung von Nummern für den Dienst \"SMS-Empfang\" von Onlinesim;\n  \n  - `rent-scope` gewährt Zugriff auf die Vermietung virtueller Telefonnummern von Onlinesim;\n  \n  - `free-scope` gewährt Zugriff auf die Verwendung kostenloser Nummern von Onlinesim.\n\n### **Registrierung Ihrer Anwendung auf unserem Autorisierungsdienst**\n\n1. Gehen Sie zur [OAuth-Seite](https:\u002F\u002Fonlinesim.io\u002Foauth)\n2. Erstellen Sie einen neuen Client und geben Sie an:\n      * `Name` - Name der Anwendung oder ein anderer Name, den Sie und Ihre Benutzer mit der Anwendung assoziieren werden;\n      * `Redirect URL` - URL, an die der Client nach der Autorisierung weitergeleitet wird und wohin der Autorisierungscode der Anwendung gesendet wird;\n      * `Confidential` - optional, markieren Sie den Client als \u003Cu>Confidential\u003C\u002Fu>, wenn Ihre Anwendung auf einem Server läuft und den \u003Cu>Client Secret\u003C\u002Fu> sicher speichern kann.\n\n![Client erstellen](\u002Fdocs\u002FCreateOAuthClient.png)\n\n3. Klicken Sie auf \"Create\". Ihre hinzugefügte Anwendung wird in der Liste der Clients angezeigt.\n\n![Client-Liste](\u002Fdocs\u002FOAuthClient.png)\n\n4. Speichern Sie `Client ID` und `Secret` an einem sicheren Ort, sie werden von Ihrer Anwendung für die Autorisierung verwendet.\n\n\u003Cspan id=\"AUTHCODE\">\u003C\u002Fspan>\n### OAuth 2.0. Authorization Code Flow\n\n#### **Benutzerautorisierung und Token-Erhaltung**\n\n1. Autorisieren Sie den Client über eine GET-Anfrage an `https:\u002F\u002Fonlinesim.io\u002Foauth\u002Fauthorize` mit den Parametern `client_id`, `redirect_uri`, `response_type`, `scope`, `state`:\n\n##### Parameterbeschreibung\n\n  Parametername | Datentyp | Beschreibung\n  -------------------|:----------:|---------\n  client_id | STRING | `Client ID`, der nach der Registrierung der Anwendung erhalten wurde\n  redirect_uri | STRING | Adresse, an die der Client nach erfolgreicher Autorisierung weitergeleitet wird, muss mit der `Redirect URL` übereinstimmen, die Sie bei der Registrierung der Anwendung angegeben haben.\n  response_type | STRING | Geben Sie `code` an\n  scope | STRING | Zugriffsrechte, deren Genehmigung Ihre Anwendung vom Benutzer anfordert. Mögliche Optionen: `sms-scope`, `rent-scope`, `free-scope`. Mehrere Werte können angegeben werden\n  state | STRING | Zufällige Zeichenfolge zum Schutz vor CSRF (überprüfen Sie sie nach der Weiterleitung)\n\n2. Nach der Anfrage an `https:\u002F\u002Fonlinesim.io\u002Foauth\u002Fauthorize` wird der Benutzer aus Ihrer Anwendung zur Autorisierungsseite weitergeleitet, wo er Benutzername und Passwort eingeben muss und bei Erfolg Ihre Anwendung für die Arbeit mit den Benutzerdaten im Onlinesim-Dienst autorisieren muss. Dazu muss er auf die Schaltfläche *`Authorize`* klicken:\n\n![OAuth-Anfrage](\u002Fdocs\u002FOAuthRequest.png)\n\n::: info\nAuf dieser Stufe können Sie den Parameter `state` überprüfen, um die sichere Interaktion mit dem Autorisierungsdienst zu bestätigen\n:::\n\n3. Bei erfolgreicher Autorisierung wird der Benutzer an die Adresse `redirect_uri` mit dem Parameter `code` weitergeleitet. Jetzt können Sie ein `access token` erhalten, dazu müssen Sie eine POST-Anfrage an `https:\u002F\u002Fonlinesim.io\u002Foauth\u002Ftoken` stellen:\n\n##### Parameterbeschreibung\n\n  Parametername | Datentyp | Beschreibung\n  ---------|:--------:|---------\n  grant_type | STRING | Autorisierungsszenario, für das Szenario Authorization Code müssen Sie `authorization_code` angeben\n  client_id | STRING | `Client ID`, der nach der Registrierung der Anwendung erhalten wurde\n  client_secret | STRING |`Client_secret`, der nach der Registrierung der Anwendung erhalten wurde\n  redirect_uri | STRING | Adresse, an die der Client nach erfolgreicher Autorisierung weitergeleitet wird, muss mit der `Redirect URL` übereinstimmen, die Sie bei der Registrierung der Anwendung angegeben haben\n  code | STRING | Autorisierungscode, der in der vorherigen Stufe erhalten wurde\n\n::: danger\n  \nDa `client_secret` ein privater Schlüssel ist, wird nicht empfohlen, ihn im Frontend des Clients zu speichern. Für mehr Sicherheit muss er im Backend Ihrer Anwendung gespeichert werden. Um das Szenario mit dem Autorisierungscode zu implementieren, muss der vom Frontend erhaltene Code an das Backend Ihres Dienstes übergeben werden, und dieses muss sich dann an den Autorisierungsdienst wenden, um das Token zu erhalten.\n:::\n\n4. Als Ergebnis einer erfolgreichen Anfrage an `https:\u002F\u002Fonlinesim.io\u002Foauth\u002Ftoken` erhalten Sie eine JSON-Antwort, die die Felder `access_token`, `refresh_token` und `expires_in` enthält. Das Feld `expires_in` bestimmt die Anzahl der Sekunden bis zum Ablauf des Zugriffstokens, `refresh_token` wird verwendet, um das Zugriffstoken bei Ablauf zu aktualisieren.\n\n---\n\n#### **Autorisierung von Anfragen an die Onlinesim API und Token-Aktualisierung**\n\nZu allen Anfragen an die API muss der Header **Authorization: Bearer *`access_token`*** hinzugefügt werden.\nWenn als Antwort auf Ihre Anfrage `ERROR_WRONG_KEY` kam, müssen Sie das Token aktualisieren oder ein neues erhalten.\n\n  ```json\n  {\n    \"response\": \"ERROR_WRONG_KEY\"\n  }\n  ```\n\nUm das Token zu aktualisieren, müssen Sie eine POST-Anfrage an `https:\u002F\u002Fonlinesim.io\u002Foauth\u002Ftoken` mit den Parametern `grant_type`, `client_id`, `client_secret` und `refresh_token` stellen. Für das Feld `refresh_token` muss der Wert verwendet werden, der in Schritt 4 erhalten wurde.\n\n##### Parameterbeschreibung\n\n  Parametername | Datentyp | Beschreibung\n  ---------|:--------:|---------\n  grant_type | STRING | Sie müssen `refresh_token` angeben\n  client_id | STRING | `client ID`, den Sie bei der Registrierung der Anwendung erhalten haben\n  client_secret | STRING | `client_secret`, der bei der Registrierung der Anwendung erhalten wurde\n  refresh_token | STRING | `refresh_token` wurde zusammen mit `access_token` erhalten. Hat eine viel längere Lebensdauer und wird verwendet, um `access_token` zu aktualisieren\n\n\n\u003Cspan id=\"IMPLICIT\">\u003C\u002Fspan>\n### OAuth 2.0. Implicit Flow\n\n#### **Benutzerautorisierung und Token-Erhaltung**\n1. Autorisieren Sie den Client über eine GET-Anfrage an `https:\u002F\u002Fonlinesim.io\u002Foauth\u002Fauthorize` mit den Parametern `client_id`, `redirect_uri`, `response_type`, `scope`, `state`:\n\n##### Parameterbeschreibung\n\n  Parametername | Datentyp | Beschreibung\n  ---------|:--------:|---------\n  client_id | STRING | `Client ID`, der bei der Registrierung der Anwendung erhalten wurde\n  redirect_uri | STRING | Adresse, an die der Client nach erfolgreicher Autorisierung weitergeleitet wird, muss mit der `Redirect URL` übereinstimmen, die Sie beim Hinzufügen der Anwendung angegeben haben.\n  response_type | STRING | Verwenden Sie `token` als Wert\n  scope | STRING | Zugriffsrechte, deren Genehmigung Ihre Anwendung vom Benutzer anfordert. Mögliche Optionen: `sms-scope`, `rent-scope`, `free-scope`. Mehrere Werte können angegeben werden\n  state | STRING | Zufällige Zeichenfolge zum Schutz vor CSRF (überprüfen Sie sie nach der Weiterleitung)\n\n2. Nach der Anfrage an `https:\u002F\u002Fonlinesim.io\u002Foauth\u002Fauthorize` wird der Benutzer aus Ihrer Anwendung zur Autorisierungsseite weitergeleitet, wo er Benutzername und Passwort eingeben muss und bei Erfolg Ihre Anwendung für die Arbeit mit den Benutzerdaten im Onlinesim-Dienst autorisieren muss. Dazu muss er auf die Schaltfläche *`Authorize`* klicken:\n\n![OAuth-Anfrage](\u002Fdocs\u002FOAuthRequest.png)\n\n::: info\nAuf dieser Stufe können Sie den Parameter `state` überprüfen, um die sichere Interaktion mit dem Autorisierungsdienst zu bestätigen\n:::\n\n3. Bei erfolgreicher Autorisierung wird der Benutzer an die Adresse `redirect_uri` mit dem Parameter `access_token` weitergeleitet. Dies ist das erforderliche Token für die Autorisierung in der Onlinesim API.\n\n---\n\n### **Autorisierung von Anfragen an die Onlinesim API**\n\nZu allen Anfragen an die API muss der Header **Authorization: Bearer *`access_token`*** hinzugefügt werden.\nWenn als Antwort auf Ihre Anfrage `ERROR_WRONG_KEY` kam, müssen Sie ein neues Token erhalten.\n\n  ```json\n  {\n    \"response\": \"ERROR_WRONG_KEY\"\n  }\n  ```\n",{"implicit":150,"authorizationCode":157},{"authorizationUrl":151,"refreshUrl":152,"scopes":153},"https:\u002F\u002Fonlinesim.io\u002Foauth\u002Fauthorize","https:\u002F\u002Fonlinesim.io\u002Foauth\u002Ftoken",{"sms-scope":154,"rent-scope":155,"free-scope":156},"grants access to manage numbers for the SMS receiving service from Onlinesim","grants access to renting phone numbers from Onlinesim","grants access to using Onlinesim free numbers",{"authorizationUrl":151,"tokenUrl":152,"scopes":158},{"sms-scope":154,"rent-scope":155,"free-scope":156},null,1795170377374]