{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"aadc4851-1d58-4693-a611-78ca43f2e80a","name":"EQ API","description":"EQ API services all client-side transactions via a REST API. All protected routes use JWT Token based authentication.\n\n### Obtaining a JWT:\n\n#### Composition\n\nEQ uses a one-time passcode based login for authentication and authorization. This replaces the previous API key based authentication.\n\n#### Workflow\n\nIn order to support the growing number of products the base URL needs to specify the stage component. As a result, authentication is now a standalone service for each product. \nThe base URL is `https://auth.eqworks.io/<stage>` where `<stage>` are either `dev` or `prod`.\n\n###### **Step 1: Login**\n\nLogin endpoint is: `https://auth.eqworks.io/<stage>/login`. The list of query string parameters:\n\n* `user`, end-user’s email address is placed in `<user email>`. This is required and must already be in EQ’s user database.\n* `redirect`, optional redirect URL, detailed example below.\n* `zone`, default is UTC, can be set to a preferred timezone.\n* `product`, now mandatory serves the purpose to scope the provisioned JWT depending on API resources. Depending on the product in use place `atom` or `locus` in the `<product name>` space.\n\n        `https://auth.eqworks.io/<stage>/login?user=<user email>&zone=<zone>&product=<product name>`\n\nThe most important change here is the redirect query string parameter which enables the API application to seamlessly integrate through the custom “magic-link”. `user` and `product` are the only parameter that persist, therefore store  the \"magic-link\" somewhere safe . \n\nFor example:\n\n`https://report.ui.project/login?a=1&b=2&user=sue.sxxxxht@gmail.com`\n\nThe generated “magic-link” will be:\n\n`https://report.ui.project/login?a=1&b=2&user=sue.sxxxxht@gmail.com&otp=<OTP>`\n\nThe URL report.ui.project will use the OTP contained within the generated “magic-link” for the next step.\n\nIf using a hardcoded redirect URL make sure it is encoded.\n\nIf no redirect is supplied, the default “magic-link” would route back to `https://auth.eqworks.io/<stage>/verify?user=sue.sxxxxht@gmail.com&otp=<OTP generated>`. This would be the URL to compose for next step.\n\nThe “magic-link” and the plain-text OTP will be delivered to user’s email.\n\n###### **Step 2: Verification**\n\nVerification is done through `https://auth.eqworks.io/<stage>/verify`. The required query string parameters are the query string [user,JWT] provided through the “magic-link” sent in the email.\n\nUpon success, this will yield the following response:\n\n```\n{\n  \"message\": \"User sue.sxxxxht@gmail.com verified, please store and use the attached token responsibly\",\n  \"user\": \"sue.sxxxxht@gmail.com\",\n  \"token\":\"<the JWT, redacted>\"\n}\n```\n\nNote that for now, JWT is set to expire in 90 days. However this can reset for another 90 days as per step 4.\n\nSubsequent data requests can all be made to appropriate stage `api.eqworks.io`. Examples of different data requests are displayed below and organized by product. You can select the preferred coding language from the `LANGUAGE` dropdown menu.  \n\nBe sure to supply the JWT within the custom HTTP header. We recommend to include `user` as well.\nFor example: \n{\n  \"eq-api-user\": user,\n  \"eq-api-jwt\": jwt,\n}\n\n###### **Step 3: Validate JWT (Optional)**\n\nThis step may be utilized as a method for validating the legitimacy of the JWT. The endpoint is `https://auth.eqworks.io/<stage>/confirm` and the JWT must be supplied through custom Header `eq-api-jwt`. \n\nAn optional `light` query string parameter is included for verification, but its integrity will not be validated against the system back-end. If a `light` query is not supplied and the return validation is false or 0, the system will perform an integrity check against the user database.\n\n###### **STEP 4: JWT Expiry Reset (OPTIONAL)**\n\nThe following is a simple way to reset the JWT expiry time and date. As a guideline JWT expiry times should be reset prior to the current expiration date and time set.\n\nThe refresh endpoint is `https://auth.eqworks.io/<stage>/refresh`, and is similar to the confirm endpoint with the exception of no light quey option. The response will include a new token with the new expiration date/time.","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":true,"owner":"10439556","collectionId":"aadc4851-1d58-4693-a611-78ca43f2e80a","publishedId":"T1LLFoGM","public":true,"publicUrl":"https://docs.eqworks.io","privateUrl":"https://go.postman.co/documentation/10439556-aadc4851-1d58-4693-a611-78ca43f2e80a","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"documentationLayout":"classic-double-column","customisation":null,"version":"8.10.0","publishDate":"2020-08-18T16:29:22.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"statusCode":200},"environments":[],"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/768118b36f06c94b0306958b980558e6915839447e859fe16906e29d683976f0","favicon":"https://eqworks.io/favicon.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"}],"canonicalUrl":"https://docs.eqworks.io/view/metadata/T1LLFoGM"}