{"_id":"55ef619ca3a8021700a4983b","user":"55eedd0b08f9423700896e64","project":"55eedd1a08f9423700896e65","__v":6,"category":{"_id":"55eedd1b08f9423700896e69","pages":["55eedd1c08f9423700896e6b","55eee2786af7743700e57ee6","55ef3df27c751f0d007ff82e","55ef619ca3a8021700a4983b"],"project":"55eedd1a08f9423700896e65","version":"55eedd1b08f9423700896e68","__v":4,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-09-08T13:05:31.554Z","from_sync":false,"order":0,"slug":"getting-started","title":"Getting started"},"version":{"_id":"55eedd1b08f9423700896e68","project":"55eedd1a08f9423700896e65","__v":11,"createdAt":"2015-09-08T13:05:31.033Z","releaseDate":"2015-09-08T13:05:31.033Z","categories":["55eedd1b08f9423700896e69","55eedf54d6e2c62b001ac0f5","55eedf63b97ce63700d0592a","55ef11c0c2c70e23001077ec","55ef1ac37c751f0d007ff7d3","55ef1ae78eb7ae0d00feeb5d","55ef1b44e7f5490d000c0e38","55ef1b552eaf2917007d6b46","55ef40ed7c751f0d007ff839","55f0391f8563861700a33771","55fb3d4aa62ba1170021aa20"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-09-08T22:30:52.086Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"Refresh Tokens are available with all access to, it allows you to regenerate the user's access token without needed secondary authorisation flow.\n\nWhen a user has authorised your request and you swap the code for an access token you are given several pieces of information along with the initial access token [See Here](/docs/authorization-flow#swapping-your-authorisation-code-for-an-access-tok)\n\nYour `access_token` is only valid for `expires_in` parameter, you will need to use your `client_id`, `client_secret` and `refresh_token` in order to regenerate an `access_token`.\n\nIn order to regenerate the `access_token` you will need to make a `POST` request to the following endpoint.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"https://accounts.biggerplate.com/oauth/token\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nYou will need to send the following parameters with the `POST` request.\n[block:parameters]\n{\n  \"data\": {\n    \"0-1\": \"The Client ID generated for your application\",\n    \"0-0\": \"client_id\",\n    \"1-1\": \"The Client Secret generated for your application\",\n    \"1-0\": \"client_secret\",\n    \"2-0\": \"refresh_token\",\n    \"2-1\": \"The `refresh_token` obtained during the initial authorisation flow\",\n    \"3-0\": \"grant_type\",\n    \"3-1\": \"Must be set to `refresh_token`\"\n  },\n  \"cols\": 2,\n  \"rows\": 5\n}\n[/block]","excerpt":"Refreshing an access token with a refresh token","slug":"refresh-tokens","type":"basic","title":"Refreshing Tokens"}

Refreshing Tokens

Refreshing an access token with a refresh token

Refresh Tokens are available with all access to, it allows you to regenerate the user's access token without needed secondary authorisation flow. When a user has authorised your request and you swap the code for an access token you are given several pieces of information along with the initial access token [See Here](/docs/authorization-flow#swapping-your-authorisation-code-for-an-access-tok) Your `access_token` is only valid for `expires_in` parameter, you will need to use your `client_id`, `client_secret` and `refresh_token` in order to regenerate an `access_token`. In order to regenerate the `access_token` you will need to make a `POST` request to the following endpoint. [block:code] { "codes": [ { "code": "https://accounts.biggerplate.com/oauth/token", "language": "text" } ] } [/block] You will need to send the following parameters with the `POST` request. [block:parameters] { "data": { "0-1": "The Client ID generated for your application", "0-0": "client_id", "1-1": "The Client Secret generated for your application", "1-0": "client_secret", "2-0": "refresh_token", "2-1": "The `refresh_token` obtained during the initial authorisation flow", "3-0": "grant_type", "3-1": "Must be set to `refresh_token`" }, "cols": 2, "rows": 5 } [/block]