{"_id":"5bbd46a1fe62fb0003d01d40","project":"59f79e3c584eb200345ceafc","version":{"_id":"5ba178b00a916500030c6a21","project":"59f79e3c584eb200345ceafc","__v":24,"forked_from":"59f79e3c584eb200345ceaff","createdAt":"2015-09-17T03:47:20.956Z","releaseDate":"2015-09-17T03:47:20.956Z","categories":["5ba178b00a916500030c69a2","5ba178b00a916500030c69a3","5ba178b00a916500030c69a4","5ba178b00a916500030c69a5","5ba178b00a916500030c69a6","5ba178b00a916500030c69a7","5ba178b00a916500030c69a8","5ba178b00a916500030c69a9","5ba178b00a916500030c69aa","5ba178b00a916500030c69ab","5ba178b00a916500030c69ac","5afb6888212c690003ae3d3b","5ba178b00a916500030c69ad","5ba178b00a916500030c69ae","5ba2dcbc99f53f0003b97e2c","5babd73fa0ab3e0003ead030","5bb4038be7222e000334dd97","5bb55954478c1300031a44c2","5bb665a1607307000327c81e","5bb6f90229a7fb0003a0650d","5bb7f9bc29a7fb0003a07ac1","5bba58bd7ba7710003bd901d","5bba6dac7ba7710003bd908d","5bba6e257ba7710003bd9090","5bbac87810189c0003e619ea","5bbb9d02b5862c00036266b2","5bbbadb6219c3e000376c2de","5bc417751d1b0000182bf7f6","5bc59e3b2a5b4f0044db5b97","5bc7bbce2262cc0041f6eff2","5bce6a3580a7250031199f34","5bcfac2c4082510019f2d91b","5bcfac3757bed90030e45d68","5bcfac45d305bc0049941539","5bd2a43548bb6f00289c8fad","5bd3a42a026ebe001f66259e","5bd9d5afffe003005b02f97b","5becb7ee85c6b300557662b6"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":false,"codename":"","version_clean":"3.2.0","version":"3.2"},"category":{"_id":"5ba178b00a916500030c69aa","project":"59f79e3c584eb200345ceafc","version":"5ba178b00a916500030c6a21","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-09-21T23:56:39.346Z","from_sync":false,"order":22,"slug":"ui-as-a-service","title":"UI as a Service"},"user":"5a68eb6970ea610012bfb924","__v":8,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-10-10T00:24:01.352Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"client_id\": \"589acd9ecb3cd400fa75ac06\",\n    \"client_name\": \"SynapseFI\",\n    \"expires_at\": \"1498297390\",\n    \"expires_in\": \"7200\",\n    \"oauth_key\": \"oauth_bo4WXMIT5V0zKSRLYcqNwGtHZEDaA1k3pBv7r20s\",\n    \"refresh_expires_in\": 8,\n    \"refresh_token\": \"refresh_ehG7YBS8ZiD0sLa6PQHMUxryovVkJzElC5gWROXq\",\n    \"scope\": [\n        \"USER|PATCH\",\n        \"USER|GET\",\n        \"NODES|POST\",\n        \"NODES|GET\",\n        \"NODE|GET\",\n        \"NODE|PATCH\",\n        \"NODE|DELETE\",\n        \"TRANS|POST\",\n        \"TRANS|GET\",\n        \"TRAN|GET\",\n        \"TRAN|PATCH\",\n        \"TRAN|DELETE\"\n    ],\n    \"user_id\": \"594e0fa2838454002ea317a0\"\n}","name":"w/o scope"},{"code":"{\n    \"client_id\": \"589acd9ecb3cd400fa75ac06\",\n    \"client_name\": \"SynapseFI\",\n    \"expires_at\": \"1498297511\",\n    \"expires_in\": \"7200\",\n    \"oauth_key\": \"oauth_YRiB3K1opexAkltDZvc4QOEMnLSCJ8m0UN6Gasyq\",\n    \"refresh_expires_in\": 7,\n    \"refresh_token\": \"refresh_ehG7YBS8ZiD0sLa6PQHMUxryovVkJzElC5gWROXq\",\n    \"scope\": [\n        \"NODES|POST\",\n        \"NODES|GET\",\n        \"NODE|GET\",\n        \"TRANS|POST\"\n    ],\n    \"user_id\": \"594e0fa2838454002ea317a0\"\n}","language":"json","status":200,"name":"with scope"}]},"settings":"","examples":{"codes":[{"language":"http","code":"POST /v3.1/oauth/594e0fa2838454002ea317a0 HTTP/1.1\nHost: uat-api.synapsefi.com\nX-SP-GATEWAY: client_id_2bb1e412edd311e6bd04e285d6015267|client_secret_2bb1e714edd311e6bd04e285d6015267\nX-SP-USER-IP: 127.0.0.1\nX-SP-USER: |e83cf6ddcf778e37bfe3d48fc78a6502062fc\nContent-Type: application/json\n\n{\n    \"refresh_token\":\"refresh_ehG7YBS8ZiD0sLa6PQHMUxryovVkJzElC5gWROXq\"\n}","name":"w/o scope"},{"code":"POST /v3.1/oauth/594e0fa2838454002ea317a0 HTTP/1.1\nHost: uat-api.synapsefi.com\nX-SP-GATEWAY: client_id_2bb1e412edd311e6bd04e285d6015267|client_secret_2bb1e714edd311e6bd04e285d6015267\nX-SP-USER-IP: 127.0.0.1\nX-SP-USER: |e83cf6ddcf778e37bfe3d48fc78a6502062fc\nContent-Type: application/json\n\n{\n    \"refresh_token\":\"refresh_ehG7YBS8ZiD0sLa6PQHMUxryovVkJzElC5gWROXq\",\n    \"scope\":[\n        \"NODES|POST\",\n        \"NODES|GET\",\n        \"NODE|GET\",\n        \"TRANS|POST\"\n    ]\n}","language":"http","name":"with scope"}]},"method":"post","auth":"required","params":[{"_id":"5573b11e91ce6e190023b76a","ref":"","in":"body","required":true,"desc":"The current refresh token associated with the user","default":"","type":"string","name":"refresh_token"},{"_id":"589b627bd23c4d1b00855fdc","ref":"","in":"body","required":false,"desc":"OAuth key scope","default":"","type":"array_string","name":"scope"},{"_id":"589b6143d23c4d1b00855fda","ref":"","in":"body","required":false,"desc":"Phone number for 2FA","default":"","type":"string","name":"phone_number"},{"_id":"589b6143d23c4d1b00855fd9","ref":"","in":"body","required":false,"desc":"Validation Pin for 2FA","default":"","type":"string","name":"validation_pin"},{"_id":"594e74a338ae590033bfd447","ref":"","in":"path","required":true,"desc":"ID of user","default":"","type":"string","name":"user_id"}],"url":"/v3.1/oauth/:user_id"},"isReference":false,"order":1,"body":"The next step after creating the user is getting the user authenticated for subsequent API calls. To get the Oauth token for the user, the refresh token from the `POST` user will be passed in the parameters of this call. A refresh token can also be retrieved by performing a `GET` on the specific user. The Oauth token will be returned in the response of this OAuth Key call and will be used in the headers of subsequent API calls to allow users to perform other actions. \n\n## API ENDPOINT\nhttps://uat-api.synapsefi.com/v3.1/oauth/:user_id\n\n##PATH PARAMETERS\n[block:html]\n{\n  \"html\": \"<div class=\\\"api-manager\\\"> <div class=\\\"param-table\\\"> <div class=\\\"table\\\"> <div class=\\\"tr\\\"> <div class=\\\"td param\\\"> <strong>user_id <span class=\\\"colon\\\">:</span> </strong> <div class=\\\"required\\\">required</div></div><div class=\\\"td\\\"> <strong class=\\\"param-type\\\">string</strong> <div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"> <p>ID of user</p></div></div></div></div></div></div>\"\n}\n[/block]\n##BODY PARAMETER\n[block:html]\n{\n  \"html\": \"<div class=\\\"api-manager\\\"> <div class=\\\"param-table\\\"> <div class=\\\"table\\\"> <div class=\\\"tr\\\"> <div class=\\\"td param\\\"> <strong>refresh_token <span class=\\\"colon\\\">:</span> </strong> <div class=\\\"required\\\">required</div></div><div class=\\\"td\\\"> <strong class=\\\"param-type\\\">string</strong> <div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"> <p>The current refresh token associated with the user</p></div></div></div><div class=\\\"tr\\\"> <div class=\\\"td param\\\"> <strong>scope <span class=\\\"colon\\\">:</span> </strong> </div><div class=\\\"td\\\"> <strong class=\\\"param-type\\\">array of strings</strong> <div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"> <p>OAuth key scope</p></div></div></div><div class=\\\"tr\\\"> <div class=\\\"td param\\\"> <strong>phone_number <span class=\\\"colon\\\">:</span> </strong> </div><div class=\\\"td\\\"> <strong class=\\\"param-type\\\">string</strong> <div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"> <p>Phone number for 2FA</p></div></div></div><div class=\\\"tr\\\"> <div class=\\\"td param\\\"> <strong>validation_pin <span class=\\\"colon\\\">:</span> </strong> </div><div class=\\\"td\\\"> <strong class=\\\"param-type\\\">string</strong> <div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"> <p>Validation Pin for 2FA</p></div></div></div></div></div></div>\"\n}\n[/block]\n\n##Additional Tips\n* Refresh tokens expire after 10 uses and update periodically. We manage this complexity for you. To get the most recent Refresh token, do a `GET` on the user.\n*  OAuth Keys currently expires in 2 hours. After a OAuth Key expires, you can use the refresh token to generate a new OAuth Key. When the OAuth Key is refreshed, a new refresh token might be issued as well.\n* For more information on OAuth, please see this section [OAuth & Fingerprint](doc:oauth-resources)\n\n##EXAMPLE REQUEST\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"POST /v3.1/oauth/5bb6ab05472e2500adffad5a HTTP/1.1\\nHost: uat-api.synapsefi.com\\nX-SP-GATEWAY: client_id_25BpgCAt3ymEJdkF8iwrKVlOqLZ071IehGTUaz6n|client_secret_bomP73QBiEHwJvO6tMCGXy8NUlgLj14xakzf50RK\\nX-SP-USER-IP: 127.0.0.1\\nX-SP-USER: |n38dj3h8NE393bv24ovoRY34kd62\\nContent-Type: application/json\\n\\n\\n{\\n    \\\"refresh_token\\\":\\\"refresh_3ZPYv0UAyKQxGpW4iM0hdT7r1j2JEuzIalLceXDt\\\"\\n}\",\n      \"language\": \"http\",\n      \"name\": \"\"\n    }\n  ]\n}\n[/block]\n##EXAMPLE RESPONSE\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"client_id\\\": \\\"5ade26b4567a900029e2afd2\\\",\\n    \\\"client_name\\\": \\\"YY Test Account\\\",\\n    \\\"expires_at\\\": \\\"1539138279\\\",\\n    \\\"expires_in\\\": \\\"7200\\\",\\n    \\\"oauth_key\\\": \\\"oauth_P0RneT8ghDzcvX45FLsUE1dk0O7mpayGoirWxtKC\\\",\\n    \\\"refresh_expires_in\\\": 9,\\n    \\\"refresh_token\\\": \\\"refresh_3ZPYv0UAyKQxGpW4iM0hdT7r1j2JEuzIalLceXDt\\\",\\n    \\\"scope\\\": [\\n        \\\"USER|PATCH\\\",\\n        \\\"USER|GET\\\",\\n        \\\"NODES|POST\\\",\\n        \\\"NODES|GET\\\",\\n        \\\"NODE|GET\\\",\\n        \\\"NODE|PATCH\\\",\\n        \\\"NODE|DELETE\\\",\\n        \\\"TRANS|POST\\\",\\n        \\\"TRANS|GET\\\",\\n        \\\"TRAN|GET\\\",\\n        \\\"TRAN|PATCH\\\",\\n        \\\"TRAN|DELETE\\\",\\n        \\\"SUBNETS|POST\\\",\\n        \\\"SUBNETS|GET\\\",\\n        \\\"SUBNET|GET\\\",\\n        \\\"SUBNET|PATCH\\\",\\n        \\\"STATEMENTS|GET\\\",\\n        \\\"STATEMENT|GET\\\"\\n    ],\\n    \\\"user_id\\\": \\\"5bb6ab05472e2500adffad5a\\\"\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Request\"\n    }\n  ]\n}\n[/block]","excerpt":"Issue an OAuth key for access to our UI products","slug":"issue-oauth-key","type":"basic","title":"Issue OAuth Key"}

Issue OAuth Key

Issue an OAuth key for access to our UI products

The next step after creating the user is getting the user authenticated for subsequent API calls. To get the Oauth token for the user, the refresh token from the `POST` user will be passed in the parameters of this call. A refresh token can also be retrieved by performing a `GET` on the specific user. The Oauth token will be returned in the response of this OAuth Key call and will be used in the headers of subsequent API calls to allow users to perform other actions. ## API ENDPOINT https://uat-api.synapsefi.com/v3.1/oauth/:user_id ##PATH PARAMETERS [block:html] { "html": "<div class=\"api-manager\"> <div class=\"param-table\"> <div class=\"table\"> <div class=\"tr\"> <div class=\"td param\"> <strong>user_id <span class=\"colon\">:</span> </strong> <div class=\"required\">required</div></div><div class=\"td\"> <strong class=\"param-type\">string</strong> <div marked=\"\" class=\"ng-isolate-scope\"> <p>ID of user</p></div></div></div></div></div></div>" } [/block] ##BODY PARAMETER [block:html] { "html": "<div class=\"api-manager\"> <div class=\"param-table\"> <div class=\"table\"> <div class=\"tr\"> <div class=\"td param\"> <strong>refresh_token <span class=\"colon\">:</span> </strong> <div class=\"required\">required</div></div><div class=\"td\"> <strong class=\"param-type\">string</strong> <div marked=\"\" class=\"ng-isolate-scope\"> <p>The current refresh token associated with the user</p></div></div></div><div class=\"tr\"> <div class=\"td param\"> <strong>scope <span class=\"colon\">:</span> </strong> </div><div class=\"td\"> <strong class=\"param-type\">array of strings</strong> <div marked=\"\" class=\"ng-isolate-scope\"> <p>OAuth key scope</p></div></div></div><div class=\"tr\"> <div class=\"td param\"> <strong>phone_number <span class=\"colon\">:</span> </strong> </div><div class=\"td\"> <strong class=\"param-type\">string</strong> <div marked=\"\" class=\"ng-isolate-scope\"> <p>Phone number for 2FA</p></div></div></div><div class=\"tr\"> <div class=\"td param\"> <strong>validation_pin <span class=\"colon\">:</span> </strong> </div><div class=\"td\"> <strong class=\"param-type\">string</strong> <div marked=\"\" class=\"ng-isolate-scope\"> <p>Validation Pin for 2FA</p></div></div></div></div></div></div>" } [/block] ##Additional Tips * Refresh tokens expire after 10 uses and update periodically. We manage this complexity for you. To get the most recent Refresh token, do a `GET` on the user. * OAuth Keys currently expires in 2 hours. After a OAuth Key expires, you can use the refresh token to generate a new OAuth Key. When the OAuth Key is refreshed, a new refresh token might be issued as well. * For more information on OAuth, please see this section [OAuth & Fingerprint](doc:oauth-resources) ##EXAMPLE REQUEST [block:code] { "codes": [ { "code": "POST /v3.1/oauth/5bb6ab05472e2500adffad5a HTTP/1.1\nHost: uat-api.synapsefi.com\nX-SP-GATEWAY: client_id_25BpgCAt3ymEJdkF8iwrKVlOqLZ071IehGTUaz6n|client_secret_bomP73QBiEHwJvO6tMCGXy8NUlgLj14xakzf50RK\nX-SP-USER-IP: 127.0.0.1\nX-SP-USER: |n38dj3h8NE393bv24ovoRY34kd62\nContent-Type: application/json\n\n\n{\n \"refresh_token\":\"refresh_3ZPYv0UAyKQxGpW4iM0hdT7r1j2JEuzIalLceXDt\"\n}", "language": "http", "name": "" } ] } [/block] ##EXAMPLE RESPONSE [block:code] { "codes": [ { "code": "{\n \"client_id\": \"5ade26b4567a900029e2afd2\",\n \"client_name\": \"YY Test Account\",\n \"expires_at\": \"1539138279\",\n \"expires_in\": \"7200\",\n \"oauth_key\": \"oauth_P0RneT8ghDzcvX45FLsUE1dk0O7mpayGoirWxtKC\",\n \"refresh_expires_in\": 9,\n \"refresh_token\": \"refresh_3ZPYv0UAyKQxGpW4iM0hdT7r1j2JEuzIalLceXDt\",\n \"scope\": [\n \"USER|PATCH\",\n \"USER|GET\",\n \"NODES|POST\",\n \"NODES|GET\",\n \"NODE|GET\",\n \"NODE|PATCH\",\n \"NODE|DELETE\",\n \"TRANS|POST\",\n \"TRANS|GET\",\n \"TRAN|GET\",\n \"TRAN|PATCH\",\n \"TRAN|DELETE\",\n \"SUBNETS|POST\",\n \"SUBNETS|GET\",\n \"SUBNET|GET\",\n \"SUBNET|PATCH\",\n \"STATEMENTS|GET\",\n \"STATEMENT|GET\"\n ],\n \"user_id\": \"5bb6ab05472e2500adffad5a\"\n}", "language": "json", "name": "Request" } ] } [/block]