Redeem a link code for the Slack user in the header (the Slack bot)
POST
/v1/integrations/slack/links
const url = 'http://127.0.0.1:8080/v1/integrations/slack/links';const options = { method: 'POST', headers: { 'Zentri-Slack-User': 'example', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"code":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://127.0.0.1:8080/v1/integrations/slack/links \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'Zentri-Slack-User: example' \ --data '{ "code": "example" }'Needs an integration token with scope slack:act-as-verified-user.
A bad, expired, or used code gets 401 invalid_link_code, the same
for each. Linking a user again replaces their old link, and both are
audited. A Slack user linked to another Zentri user gets 409
slack_user_linked.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Zentri-Slack-User
required
string
The Slack user, <team_id>:<user_id>, from a request Slack signed.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
code
required
Case and the letters I, L, and O are forgiven.
string
Example generated
{ "code": "example"}Responses
Section titled “Responses”The linked user.
Media typeapplication/json
object
user
required
object
id
required
string format: uuid
handle
required
string
role
required
string
replaced
required
The user had another Slack link, which this one replaced.
boolean
Example
{ "user": { "role": "viewer" }}The request is malformed.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
Example generated
{ "error": { "code": "example", "message": "example" }}No valid bearer token.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
Example generated
{ "error": { "code": "example", "message": "example" }}The token may not do this.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
Example generated
{ "error": { "code": "example", "message": "example" }}The request clashes with current state.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
Example generated
{ "error": { "code": "example", "message": "example" }}A rate limit or quota stopped the request. Retry-After gives seconds to wait.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
Example generated
{ "error": { "code": "example", "message": "example" }}Headers
Section titled “Headers”Retry-After
integer