{"__v":0,"_id":"53fe84c8addab8973c1af2d4","category":{"__v":4,"_id":"53fe836faddab8973c1af2ce","pages":["53fe84c8addab8973c1af2d4","53ff936c23a37e1d5cebafc7","53ff947e23a37e1d5cebafca","55b27b2788093a21008bef06"],"project":"53fe6dc5addab8973c1af267","version":"53fe6dc5addab8973c1af26a","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-08-28T01:18:39.777Z","from_sync":false,"order":3,"slug":"api-reference","title":"API Reference"},"comments":[],"editedParams":true,"editedParams2":true,"is_link":false,"parentDoc":null,"project":"53fe6dc5addab8973c1af267","tags":[],"user":"53fe6d8baddab8973c1af266","version":{"__v":19,"_id":"53fe6dc5addab8973c1af26a","project":"53fe6dc5addab8973c1af267","createdAt":"2014-08-27T23:46:13.941Z","releaseDate":"2014-08-27T23:46:13.941Z","categories":["53fe6dc5addab8973c1af26b","53fe71a2addab8973c1af276","53fe7d89addab8973c1af2b0","53fe7d8daddab8973c1af2b1","53fe836faddab8973c1af2ce","53ff9a4823a37e1d5cebafe1","53ff9e3723a37e1d5cebaff7","53ffaca523a37e1d5cebb039","53ffad2e23a37e1d5cebb03c","5400c7d2ec93b29b61d4f7be","5400f0e1ec93b29b61d4f7dd","54d5636323010a0d001aca81","54d565c1276f8e0d00feab54","54ff40532882a10d00546927","556606d25561af0d008208b7","558c91900b236c2500d37c9a","56180a14f8c9632100ac7599","564fb3a59b4fab1700187518","5702e2d2f2d6f336005e901f"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2014-08-28T01:24:24.909Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"basic_auth":false,"examples":{"codes":[]},"results":{"codes":[{"status":200,"language":"json","code":"{\n  success: true,\n  access_token: '7b2860a7fb1e055917b0a3bc748449ea'\n}","name":null},{"status":403,"language":"json","code":"{\n  error: 'Invalid App ID.'\n}","name":"Failure — Invalid App ID"},{"status":403,"name":"Failure — Invalid App Secret","language":"json","code":"{\n  error: 'Invalid App Secret.'\n}"},{"status":403,"name":"Failure — Invalid OAuth Code","language":"json","code":"{\n  error: 'Invalid OAuth Code.'\n}"},{"name":"Failure — Invalid Logout Hook","status":400,"language":"json","code":"# This error is only returned when setting a custom logout hook \n#\n# http://docs.getclef.com/v1.0/docs/handling-the-logout-webhook#using-per-login-logout-hooks\n#\n\n{\n  error: \"Invalid logout hook URL. The logout hook URL does not match the application's domain.\"\n}"}]},"settings":"","try":false,"auth":"never","params":[{"_id":"53fe84c8addab8973c1af2d7","ref":"","in":"body","required":false,"desc":"The OAuth code you get when we redirect from the login page.","default":"","type":"string","name":"code"},{"_id":"53fe84c8addab8973c1af2d6","ref":"","in":"body","required":false,"desc":"Your application ID","default":"","type":"string","name":"app_id"},{"_id":"53fe84c8addab8973c1af2d5","ref":"","in":"body","required":false,"desc":"Your application secret","default":"","type":"string","name":"app_secret"}],"url":"/authorize"},"isReference":false,"order":0,"body":"Use the `/authorize` route to exchange the OAuth code you received at your OAuth callback URL for an OAuth token.\n\nThe `/authorize` route takes URL-encoded form data.","excerpt":"The API route to exchange an OAuth code for an OAuth token","slug":"apiv1authorize","type":"post","title":"/api/v1/authorize"}

post/api/v1/authorize

The API route to exchange an OAuth code for an OAuth token

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

code:
string
The OAuth code you get when we redirect from the login page.
app_id:
string
Your application ID
app_secret:
string
Your application secret

Result Format


Documentation

Use the `/authorize` route to exchange the OAuth code you received at your OAuth callback URL for an OAuth token. The `/authorize` route takes URL-encoded form data.

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}