{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"cdf84406-6d77-4440-ac50-c9836c7cb252","name":"ORE ID - API Reference - Public","description":"![ORE ID Logo](https://storage.googleapis.com/aikon-assets/Logo_OREIDMark_150.png \"ORE ID Logo\")\n\n# Getting Started with ORE ID\n\nThe easiest way to use ORE ID is the **eos-auth** library<br/>\n\n```\nnpm install oreid-js --save\n```\n<br/>\n\nBest place to see how to use eos-auth is to check the [**example apps**](https://github.com/API-market/ore-id-docs/tree/master/examples) inside the [**ore-id-docs**](https://github.com/API-market/ore-id-docs) repo on Github.  Look inside the examples folder in the repo.\n\n<br/>\n\n---\n\n\n# Simple example\n\n```javascript\n\nimport { OreId } from 'oreid-js';\n\n// Create an OreId object to initialize the library\nlet oreId = new OreId({ appName:\"My App\", appId, apiKey, ... })\n\n// Start the OAuth flow by setting browser to URL returned by login\nlet loginResponse = await oreId.login({provider:'facebook'});\nwindow.location = loginResponse.loginUrl\n\n// Get the user's info given a blockchain account\nlet userInfo = await oreId.getUser(loginResponse.account)\n\n// Start the ORE ID signing process\nlet signResponse = await oreId.sign(signOptions)\nwindow.location = signResponse.signUrl\n\n// Start the signing process using local wallet app like scatter\nlet signResponse = await oreId.sign({provider:'scatter', chainNetwork:'eos_kylin', transaction, ...})\nconsole.log(signResponse.signedTransaction)\n\n```\n\n<br/>\n\nHere are the public functions you can call inside eos-auth.\n\n<br/>\n\n---\n\n\n# OreId Class\n\n**const oreId = new OreId( {options} )**\n\nRequired options:\n\n  * **appId:** The app id from the ORE ID app you created\n  * **apiKey:** The api key from the ORE ID app you created\n  * **oreIdUrl:** 'https://service.oreid.io'\n\nOptional options:\n\n  * **serviceKey:** The service key for the **ORE ID Enterprise** apps you created (Only available with **ORE ID Enterprise**)\n  * **appName:** The name of your app presented to the eos-transit enabled wallet (e.g. Scatter)\n  * **eosTransitWalletProviders:** An array of provider wallets (see react example)\n  * **authCallbackUrl:** 'http://example.com/authcallback'\n  * **signCallbackUrl:** 'https://example.com/signcallback'\n  * **setBusyCallback:** Optional callback for tracking busy state eg. (isBusy) => {this.setState({isBusy})};\n  * **backgroundColor:** A hex color '#ff00ff' for the background color for pages on ORE ID\n\n<br/>\n\n---\n\n\n# Public functions on an OreId instance\n\n<table>\n  <tr>\n    <th>function()</th>\n    <th>Description</th>\n  </tr>\n  <tr>\n    <th>async login( {loginOptions} )</th>\n    <td>loginOptions={ provider, chainNetwork, email, phone, code, newAccountPassword }\n      Logs the user in for the given provider (facebook, google, phone...)\n      If performing a passwordless login, also include the email or phone, and code, otherwise these parameters are not needed.\n\n      The `newAccountPassword` (OPTIONAL) Allows you to manually set a users password (Only available with **ORE ID Enterprise**)\n    </td>\n  </tr>\n  <tr>\n    <th>logout()</th>\n    <td>Logs the user out.</td>\n  </tr>\n  <tr>\n    <th>async sign(signOptions)</th>\n    <td>signOptions={ account, broadcast, callbackUrl, chainNetwork, state, transaction }\n      <br />\n      Signs a transaction. The account, chainNetwork and transaction are required. The state can be any URL safe string that is passed back as a query parameter in the callbackUrl. Account is the 12 character account name.\n    </td>\n  </tr>\n  <tr>\n    <th>async getUser(account)</th>\n    <td>Account is the 12 character account name</td>\n  </tr>\n  <tr>\n    <th>async passwordlessSendCodeApi(options)</th>\n    <td>options = { provider, phone, email }\n      <br />\n      Provider is either 'email' or 'phone'. Pass in the phone number if provider is phone and email if the provider is email.\n    </td>\n  </tr>\n  <tr>\n    <th>async passwordlessVerifyCodeApi(options)</th>\n    <td>\n      options = { provider, phone, email, code }\n      <br />\n      Provider is either 'email' or 'phone'. Pass in the phone number if provider is phone and email if the provider is email.  The code is the code received in the sms or email sent to the user.\n    </td>\n  </tr>\n  <tr>\n    <th>canDiscover(provider)</th>\n    <td>Whether an eos-transit enabled wallet supports key discovery - provider must be one of the eos-transit wallet provider names (e.g. scatter, ledger, etc.). See below for list.\n      <br />\n      returns true or false\n    </td>\n  </tr>\n  <tr>\n    <th>async discover(discoverOptions)</th>\n    <td>discoverOptions = {provider, chainNetwork}</td>\n  </tr>\n  <tr>\n    <th>async getConfig(configType)</th>\n    <td>configType = 'chains' is the only currently supported type</td>\n  </tr>\n  <tr>\n    <th>async addPermission(account, chainAccount, chainNetwork, publicKey, parentPermission, permission, provider)</th>\n    <td>provider - one of facebook, google, phone...\n    <br />\n    account - the 12 character account name\n    <br />\n    publicKey - the public key you would like to add to the account\n    </td>\n  </tr>\n</table>\n\n<br/>\n\n---\n\n# EOS Transit Integration\n\neos-transit is an open source project that provides compatibility with many EOS wallets. It is integrated into the ORE ID library. You can easily authenticate or sign with keys in a wallet by just using the transit wallet provider name as the 'provider' parameter in calls to the ORE ID library.\n\n**Providers** for eos-transit enable wallets: keycat, ledger, lynx, meetone, metro, portis, scatter, simpleos, tokenpocket, whalevault\n\nMore info: [**eos-transit**](https://github.com/eosnewyork/eos-transit) repo on Github. \n\n<br/>\n\n---\n\n# Error codes\n\n<div id='error-codes'> \n\n<div>\n<div>General errors.</div>\n\n<table>\n  <tr>\n    <th>Error code</th>\n    <th>Description</th>\n  </tr>\n  \n  <tr>\n    <td>400-404</td>\n    <td>An error occured on the client side.  Make sure your hitting the correct endpoint URL.</td>\n  </tr>\n  <tr>\n    <td>500-510</td>\n    <td>An error occured on the server side.  Something went wrong on the server. Check to make sure the parameters you pass are valid.</td>\n  </tr> \n </table>\n</div>\n\n<br />\n\n<div>\n<div>Errors for the <strong>/auth</strong> endpoint.</div>\n\n<table>\n  <tr>\n    <th>Error code</th>\n    <th>Description</th>\n  </tr>\n  <tr>\n    <td>app_access_token_missing_or_invalid</td>\n    <td>For each request, pass in a valid app-access-token with each request. Each token can only be used once. You get a token by calling the /access-token API endpoint.</td>\n  </tr>\n  <tr>\n    <td>provider_missing_or_invalid</td>\n    <td>Must pass in one of the valid providers (i.e. facebook, google) with the auth request</td>\n  </tr>\n  <tr>\n    <td>cant_send_login_code</td>\n    <td>An error occured trying to verify code used for passwordless login.</td>\n  </tr>\n  <tr>\n    <td>invalid_user_password</td>\n    <td>The code sent for passwordless login was invalid or expired.</td>\n  </tr>\n  <tr>\n    <td>invalid_login_code</td>\n    <td>The code sent for passwordless login was invalid or expired.</td>\n  </tr>\n  <tr>\n    <td>cant_verify_login_code</td>\n    <td>An error occured trying to verify code used for passwordless login.</td>\n  </tr>\n  <tr>\n    <td>access_denied</td>\n    <td>The code sent for passwordless login was invalid or expired.</td>\n  </tr> \n  <tr>\n    <td>unknown_error</td>\n    <td>An unknown error occurred trying to login.</td>\n  </tr>\n</table>\n</div>\n\n<br />\n\n<div> \n<div>Errors for the <strong>/sign</strong> endpoint.</div>\n\n<table>\n  <tr>\n    <th>Error code</th>\n    <th>Description</th>\n  </tr>\n  <tr>\n    <td>account_isnt_a_user</td>\n    <td>Failed to find the account</td>\n  </tr>\n  <tr>\n    <td>bad-param_app-access_token</td>\n    <td>For each request, pass in a valid app-access-token with each request. Each token can only be used once. You get a token by calling the /access-token API endpoint.</td>\n  </tr>\n  <tr>\n    <td>missing-param_account</td>\n    <td>The 'account' parameter was not found in the sign url.</td>\n  </tr>\n  <tr>\n    <td>missing-param_chain-network</td>\n    <td>The 'chain_network' parameter was not found in the sign url.</td>\n  </tr>\n  <tr>\n    <td>missing-param_chain_account</td>\n    <td>The 'chain_account' parameter was not found in the sign url.</td>\n  </tr>\n  <tr>\n    <td>missing-param_transaction</td>\n    <td>The 'transaction' parameter was not found in the sign url.</td>\n  </tr>\n  <tr>\n    <td>badWalletPassword</td>\n    <td>The password (or PIN) is not correct</td>\n  </tr>\n  <tr>\n    <td>sign_transaction_rejected</td>\n    <td>The transaction being signed was rejected by the blockchain.</td>\n  </tr>\n  <tr>\n    <td>sign_transaction_unknown_error</td>\n    <td>The transaction being signed is invalid.</td>\n  </tr>\n      <tr>\n    <td>callback_missing</td>\n    <td>The 'callback_url' parameter was not found in the sign url.</td>\n  </tr>\n    <tr>\n    <td>callback_invalid</td>\n    <td>Make sure your callback url is included in the app registration settings.</td>\n  </tr>\n</table>\n</div>\n</div>\n","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"7805568","team":400540,"collectionId":"cdf84406-6d77-4440-ac50-c9836c7cb252","publishedId":"SWE55yRe","public":true,"publicUrl":"https://api.oreid.io","privateUrl":"https://go.postman.co/documentation/7805568-cdf84406-6d77-4440-ac50-c9836c7cb252","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"documentationLayout":"classic-double-column","customisation":null,"version":"8.10.1","publishDate":"2023-03-01T20:29:26.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"statusCode":200},"environments":[{"name":"Demo App","id":"c73117ff-95ab-40f7-95d0-6606c014ddca","owner":"7805568","values":[{"key":"api_key","value":"demo_k_97b33a2f8c984fb5b119567ca19e4a49","enabled":true},{"key":"oreid_url","value":"https://service.oreid.io","enabled":true},{"key":"service_key","value":"demo_service_cf2b4097a2bec7f90267d172","enabled":true},{"key":"sample_transaction","value":"ewoJImFjY291bnQiOiAiZGVtb2FwcGhlbGxvIiwKCSJuYW1lIjogImhpIiwKCSJhdXRob3JpemF0aW9uIjogWwoJCXsgImFjdG9yIjogIm9yZTFwa2l3ZTU1dyIsICJwZXJtaXNzaW9uIjogImFwcGRlbW9hcHBsaSIgfQoJXSwKCSJkYXRhIjogeyAidXNlciI6ICJvcmUxcGtpd2U1NXciIH0KfQ==","enabled":true},{"key":"sample_user_password","value":"2233","enabled":true},{"key":"oreid_graphql_token","value":"ey...","enabled":true},{"key":"oreid_graphql-test_token","value":"ey...","enabled":true},{"key":"service_key_airdrop","value":"demo_service_cf2b4097a2bec7f90267d172","enabled":true}],"published":true}],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/ee3032096454a18a93b1247f5c875092a6fc724379d0e429455cb998fe6c00b0","favicon":"https://res.cloudinary.com/postman/image/upload/v1565633902/team/csmlkxypy7rnislyt6ma.ico"},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"},{"label":"Demo App","value":"7805568-c73117ff-95ab-40f7-95d0-6606c014ddca"}],"canonicalUrl":"https://documenter.gw.postman.com/view/metadata/SWE55yRe"}