リファレンスHTTP APILinked accounts
Finish linking with the code Slack returned
POST
Spends the state cookie, exchanges the code and verifies the id_token, then links the Slack account to the caller and writes a link_account receipt. Refused when the account's Slack team is not installed for the workspace, when the account is linked to someone else (never overwritten), or when the caller already linked another account in that team. API keys are refused.
Auth: cookie session only; no scope. Idempotency-Key: ignored.
cookieSessioncookie
__Host-werft_session<token>For the web console: the browser session cookie set by POST /v1/auth/login. It holds the scopes of the user's workspace role (owner: all; admin and member: all but sessions:recover). Requests other than GET must also send X-Requested-With: werft-web.
X-Requested-With?"werft-web"Required with a cookie session: the literal werft-web.
Value in
"werft-web"application/json- body
code*stringLength
1 <= length <= 2048state*stringLength
1 <= length <= 512Success
application/json- response
linked_account*receipt_id*stringMatch
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Format
uuidcurl -X POST 'https://example.com/v1/linked-accounts/slack/callback' \ -H 'Content-Type: application/json' \ -d '{ "code": "string", "state": "string"}'Example Response
{ "linked_account": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5", "provider": "slack", "external_tenant": "string", "external_user_id": "string", "external_tenant_name": "string", "external_user_name": "string", "status": "active", "verified_at": "2019-08-24T14:15:22Z", "revision": 0, "expires_at": "2019-08-24T14:15:22Z" }, "receipt_id": "64d0a161-468e-472a-b00e-a06ee9ab7de7"}