{"_id":"59f79e3c584eb200345cebdc","category":{"_id":"59f79e3c584eb200345ceb3e","__v":0,"project":"59f79e3c584eb200345ceafc","version":"59f79e3c584eb200345ceaff","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-09-23T03:46:55.703Z","from_sync":false,"order":4,"slug":"oauth","title":"OAuth & Fingerprint"},"parentDoc":null,"project":"59f79e3c584eb200345ceafc","user":"54e4044e8ef7552300409dcb","version":{"_id":"59f79e3c584eb200345ceaff","project":"59f79e3c584eb200345ceafc","__v":8,"createdAt":"2015-09-17T03:47:20.956Z","releaseDate":"2015-09-17T03:47:20.956Z","categories":["59f79e3c584eb200345ceb3a","59f79e3c584eb200345ceb3b","59f79e3c584eb200345ceb3c","59f79e3c584eb200345ceb3d","59f79e3c584eb200345ceb3e","59f79e3c584eb200345ceb3f","59f79e3c584eb200345ceb45","59f79e3c584eb200345ceb46","59f79e3c584eb200345ceb48","59f79e3c584eb200345ceb49","5aa21b60c0bda0002d1568b6","5afb6888212c690003ae3d3b","5b4bdcd3737d1800031d2293","5b9ed89212362100036b5a1c","5bb29bec77c22500034757ea","5bb29bfe77c22500034757ec","5bc8fa8063924c00186c5ded","5bc8fe9fa472190014a6b103"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"3.1.0","version":"3.1"},"__v":4,"githubsync":"","updates":["56072133a4574a0d00811433","589b88be1e7c040f00ae348c","59027f7fb4fba1230094c900"],"next":{"pages":[],"description":""},"createdAt":"2015-09-23T03:49:21.845Z","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":true,"order":1,"body":"[block:api-header]\n{\n  \"type\": \"basic\"\n}\n[/block]\n## OAuth Scopes\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Scope\",\n    \"h-1\": \"Comment\",\n    \"0-0\": \"USER|PATCH\",\n    \"1-0\": \"USER|GET\",\n    \"2-0\": \"NODES|POST\",\n    \"3-0\": \"NODES|GET\",\n    \"4-0\": \"NODE|GET\",\n    \"5-0\": \"NODE|PATCH\",\n    \"6-0\": \"NODE|DELETE\",\n    \"7-0\": \"TRANS|POST\",\n    \"8-0\": \"TRANS|GET\",\n    \"9-0\": \"TRAN|GET\",\n    \"10-0\": \"TRAN|PATCH\",\n    \"11-0\": \"TRAN|DELETE\",\n    \"0-1\": \"OAuth can be used to update User document\",\n    \"1-1\": \"OAuth can be used to get User\",\n    \"2-1\": \"OAuth can be used to add Nodes\",\n    \"3-1\": \"OAuth can be used to get Nodes\",\n    \"4-1\": \"OAuth can be used to get Node\",\n    \"5-1\": \"OAuth can be used to update Node\",\n    \"6-1\": \"OAuth can be used to delete Node\",\n    \"7-1\": \"OAuth can be used to add Transaction\",\n    \"8-1\": \"OAuth can be used to get Transactions\",\n    \"9-1\": \"OAuth can be used to get Transaction\",\n    \"10-1\": \"OAuth can be used to update Transaction\",\n    \"11-1\": \"OAuth can be used to cancel Transaction\",\n    \"12-0\": \"SUBNETS|POST\",\n    \"13-0\": \"SUBNETS|GET\",\n    \"14-0\": \"SUBNET|GET\",\n    \"15-0\": \"SUBNET|PATCH\",\n    \"16-0\": \"STATEMENTS|GET\",\n    \"17-0\": \"STATEMENT|GET\",\n    \"12-1\": \"OAuth can be used to create Subnets\",\n    \"13-1\": \"OAuth can be used to get Subnets\",\n    \"14-1\": \"OAuth can be used to get a Subnet\",\n    \"15-1\": \"OAuth can be used to update a Subnet\",\n    \"16-1\": \"OAuth can be used to get Statements\",\n    \"17-1\": \"OAuth can be used to get a Statement\"\n  },\n  \"cols\": 2,\n  \"rows\": 18\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\"\n}\n[/block]\n\n## Registering New Fingerprint\n\nIf you wish to register a new device fingerprint to the user account and use our two factor authentication (2FA) security protocols, complete the the following steps:\n\n* Step 1: Supply the new fingerprint.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"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: |e83cf6ddcf778e37bfe3d48fc78a6502062fcxx\\nContent-Type: application/json\\n\\n{\\n    \\\"refresh_token\\\":\\\"refresh_ehG7YBS8ZiD0sLa6PQHMUxryovVkJzElC5gWROXq\\\"\\n}\",\n      \"language\": \"http\",\n      \"name\": \"Request\"\n    },\n    {\n      \"code\": \"{\\n    \\\"error\\\": {\\n        \\\"en\\\": \\\"Fingerprint not registered. Please perform the MFA flow.\\\"\\n    },\\n    \\\"error_code\\\": \\\"10\\\",\\n    \\\"http_code\\\": \\\"202\\\",\\n    \\\"phone_numbers\\\": [\\n        \\\"test:::at:::synapsefi.com\\\",\\n        \\\"901-111-2222\\\"\\n    ],\\n    \\\"success\\\": false\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Response\"\n    }\n  ]\n}\n[/block]\n* Step 2: Supply 2FA device from the list.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"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: |e83cf6ddcf778e37bfe3d48fc78a6502062fcxx\\nContent-Type: application/json\\n\\n{\\n    \\\"refresh_token\\\":\\\"refresh_ehG7YBS8ZiD0sLa6PQHMUxryovVkJzElC5gWROXq\\\",\\n    \\\"phone_number\\\":\\\"[email protected]\\\"\\n}\",\n      \"language\": \"curl\",\n      \"name\": \"Request\"\n    },\n    {\n      \"code\": \"{\\n    \\\"error_code\\\": \\\"10\\\",\\n    \\\"http_code\\\": \\\"202\\\",\\n    \\\"message\\\": {\\n        \\\"en\\\": \\\"MFA sent to [email protected]\\\"\\n    },\\n    \\\"success\\\": true\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Response\"\n    }\n  ]\n}\n[/block]\n* Step 3: Verify the PIN sent to the 2FA device.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"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: |e83cf6ddcf778e37bfe3d48fc78a6502062fcxx\\nContent-Type: application/json\\n\\n{\\n    \\\"refresh_token\\\":\\\"refresh_ehG7YBS8ZiD0sLa6PQHMUxryovVkJzElC5gWROXq\\\",\\n    \\\"validation_pin\\\":\\\"594230\\\"\\n}\",\n      \"language\": \"curl\",\n      \"name\": \"Request\"\n    },\n    {\n      \"code\": \"{\\n    \\\"client_id\\\": \\\"589acd9ecb3cd400fa75ac06\\\",\\n    \\\"client_name\\\": \\\"SynapseFI\\\",\\n    \\\"expires_at\\\": \\\"1498297791\\\",\\n    \\\"expires_in\\\": \\\"7200\\\",\\n    \\\"oauth_key\\\": \\\"oauth_vxGS10t7OQzBoVJIM4Z0rbnjyXsc8lCigaH6ewRp\\\",\\n    \\\"refresh_expires_in\\\": 6,\\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}\",\n      \"language\": \"json\",\n      \"name\": \"Response\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"get-oauth_key-refresh-token","type":"endpoint","title":"OAuth User"}

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

user_id:
required
string
ID of user

Body Params

refresh_token:
required
string
The current refresh token associated with the user
scope:
array of strings
OAuth key scope
phone_number:
string
Phone number for 2FA
validation_pin:
string
Validation Pin for 2FA

Examples


Result Format


Documentation

[block:api-header] { "type": "basic" } [/block] ## OAuth Scopes [block:parameters] { "data": { "h-0": "Scope", "h-1": "Comment", "0-0": "USER|PATCH", "1-0": "USER|GET", "2-0": "NODES|POST", "3-0": "NODES|GET", "4-0": "NODE|GET", "5-0": "NODE|PATCH", "6-0": "NODE|DELETE", "7-0": "TRANS|POST", "8-0": "TRANS|GET", "9-0": "TRAN|GET", "10-0": "TRAN|PATCH", "11-0": "TRAN|DELETE", "0-1": "OAuth can be used to update User document", "1-1": "OAuth can be used to get User", "2-1": "OAuth can be used to add Nodes", "3-1": "OAuth can be used to get Nodes", "4-1": "OAuth can be used to get Node", "5-1": "OAuth can be used to update Node", "6-1": "OAuth can be used to delete Node", "7-1": "OAuth can be used to add Transaction", "8-1": "OAuth can be used to get Transactions", "9-1": "OAuth can be used to get Transaction", "10-1": "OAuth can be used to update Transaction", "11-1": "OAuth can be used to cancel Transaction", "12-0": "SUBNETS|POST", "13-0": "SUBNETS|GET", "14-0": "SUBNET|GET", "15-0": "SUBNET|PATCH", "16-0": "STATEMENTS|GET", "17-0": "STATEMENT|GET", "12-1": "OAuth can be used to create Subnets", "13-1": "OAuth can be used to get Subnets", "14-1": "OAuth can be used to get a Subnet", "15-1": "OAuth can be used to update a Subnet", "16-1": "OAuth can be used to get Statements", "17-1": "OAuth can be used to get a Statement" }, "cols": 2, "rows": 18 } [/block] [block:api-header] { "type": "basic" } [/block] ## Registering New Fingerprint If you wish to register a new device fingerprint to the user account and use our two factor authentication (2FA) security protocols, complete the the following steps: * Step 1: Supply the new fingerprint. [block:code] { "codes": [ { "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: |e83cf6ddcf778e37bfe3d48fc78a6502062fcxx\nContent-Type: application/json\n\n{\n \"refresh_token\":\"refresh_ehG7YBS8ZiD0sLa6PQHMUxryovVkJzElC5gWROXq\"\n}", "language": "http", "name": "Request" }, { "code": "{\n \"error\": {\n \"en\": \"Fingerprint not registered. Please perform the MFA flow.\"\n },\n \"error_code\": \"10\",\n \"http_code\": \"202\",\n \"phone_numbers\": [\n \"[email protected]\",\n \"901-111-2222\"\n ],\n \"success\": false\n}", "language": "json", "name": "Response" } ] } [/block] * Step 2: Supply 2FA device from the list. [block:code] { "codes": [ { "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: |e83cf6ddcf778e37bfe3d48fc78a6502062fcxx\nContent-Type: application/json\n\n{\n \"refresh_token\":\"refresh_ehG7YBS8ZiD0sLa6PQHMUxryovVkJzElC5gWROXq\",\n \"phone_number\":\"[email protected]\"\n}", "language": "curl", "name": "Request" }, { "code": "{\n \"error_code\": \"10\",\n \"http_code\": \"202\",\n \"message\": {\n \"en\": \"MFA sent to [email protected]\"\n },\n \"success\": true\n}", "language": "json", "name": "Response" } ] } [/block] * Step 3: Verify the PIN sent to the 2FA device. [block:code] { "codes": [ { "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: |e83cf6ddcf778e37bfe3d48fc78a6502062fcxx\nContent-Type: application/json\n\n{\n \"refresh_token\":\"refresh_ehG7YBS8ZiD0sLa6PQHMUxryovVkJzElC5gWROXq\",\n \"validation_pin\":\"594230\"\n}", "language": "curl", "name": "Request" }, { "code": "{\n \"client_id\": \"589acd9ecb3cd400fa75ac06\",\n \"client_name\": \"SynapseFI\",\n \"expires_at\": \"1498297791\",\n \"expires_in\": \"7200\",\n \"oauth_key\": \"oauth_vxGS10t7OQzBoVJIM4Z0rbnjyXsc8lCigaH6ewRp\",\n \"refresh_expires_in\": 6,\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}", "language": "json", "name": "Response" } ] } [/block]