{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","params":[],"results":{"codes":[]},"settings":""},"next":{"description":"","pages":[]},"title":"Connecting to an Account","type":"basic","slug":"connecting-to-an-account","excerpt":"","body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Did you already register your application?\",\n  \"body\": \"The following steps assume you have already [registered your application](doc:registering-an-application)!\"\n}\n[/block]\nIn order to connect a user to your Application to allow you execute API calls on their behalf, you will need to go through the following steps:\n\n1. Starting on a page on your site, the user will be sent to the [/authorize](doc:authorize) endpoint.\n2. Once on the authorize page, the user will be prompted to connect their Streamlabs account to your application for API access to their account.\n3. The user will decide to approve access or to decline. Regardless of their selection, they will be sent back to the **redirect_uri** for your client along with an authorization **code** or an error. Authorization codes expire after 5 minutes, so you should exchange them immediately for an access_token and refresh_token as outlined in the next step.\n4. If the user approved access, take the **code** parameter and use the [/token](doc:token) endpoint to receive an **access_token** and **refresh_token**.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/a339f59-Screen_Shot_2017-03-15_at_5.59.03_PM.png\",\n        \"Screen Shot 2017-03-15 at 5.59.03 PM.png\",\n        2232,\n        1396,\n        \"#f3f4f4\"\n      ]\n    }\n  ]\n}\n[/block]","updates":["569f810897472b17002015f3","587e455f18c2e22f00fe7f66","5886a1556f829637001038cc","5886a16dd5df950f00a7bd67","5886a1c31f5b5d0f00448bba","5886a1edc17f9c1b0050030c","5886a615d6838d2500511d24","588f79eb6bc3360f0068d2db","58b02d793529383900a75958"],"order":3,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"55bafa293f0767230008f536","category":{"sync":{"isSync":false,"url":""},"pages":["55baca9dd0736b3100bf100e","55baf4053f0767230008f52d","55bafa293f0767230008f536","55bafd35d0736b3100bf1052","55bb033f3f0767230008f544","55bee746ad601c2b00762bd8"],"title":"Documentation","slug":"documentation","order":0,"from_sync":false,"reference":false,"_id":"55baca9dd0736b3100bf100c","version":"55baca9cd0736b3100bf100b","project":"55baca9cd0736b3100bf1008","__v":6,"createdAt":"2015-07-31T01:08:45.128Z"},"project":"55baca9cd0736b3100bf1008","version":{"version":"1.0","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":true,"is_hidden":false,"is_deprecated":false,"categories":["55baca9dd0736b3100bf100c","55bacba0d0736b3100bf1017","55bad8f33f0767230008f517","55baf3f01b0d66370078166e","55baf4151b0d66370078166f","55f1cca35fe76419007dc794","573e2d6e610a090e00ca2b97","58d97ce57718211b0028e6bc","599b510cb683b50031a35299","5a871c493948fd004697e677"],"_id":"55baca9cd0736b3100bf100b","createdAt":"2015-07-31T01:08:44.540Z","project":"55baca9cd0736b3100bf1008","__v":10,"releaseDate":"2015-07-31T01:08:44.540Z"},"githubsync":"","parentDoc":null,"user":"55baca333f0767230008f4ff","__v":28,"createdAt":"2015-07-31T04:31:37.812Z"}

Connecting to an Account


[block:callout] { "type": "info", "title": "Did you already register your application?", "body": "The following steps assume you have already [registered your application](doc:registering-an-application)!" } [/block] In order to connect a user to your Application to allow you execute API calls on their behalf, you will need to go through the following steps: 1. Starting on a page on your site, the user will be sent to the [/authorize](doc:authorize) endpoint. 2. Once on the authorize page, the user will be prompted to connect their Streamlabs account to your application for API access to their account. 3. The user will decide to approve access or to decline. Regardless of their selection, they will be sent back to the **redirect_uri** for your client along with an authorization **code** or an error. Authorization codes expire after 5 minutes, so you should exchange them immediately for an access_token and refresh_token as outlined in the next step. 4. If the user approved access, take the **code** parameter and use the [/token](doc:token) endpoint to receive an **access_token** and **refresh_token**. [block:image] { "images": [ { "image": [ "https://files.readme.io/a339f59-Screen_Shot_2017-03-15_at_5.59.03_PM.png", "Screen Shot 2017-03-15 at 5.59.03 PM.png", 2232, 1396, "#f3f4f4" ] } ] } [/block]