Finish a Slack install: check the `state`, spend it, exchange the code.
const url = 'https://api.siteqwality.com/integration/slack';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"state":"example","code":"example","error":"example","friendly_name":"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 https://api.siteqwality.com/integration/slack \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "state": "example", "code": "example", "error": "example", "friendly_name": "example" }'Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”object
The state Slack returned to the callback, as issued by
POST /integration/slack/install.
The code Slack returned. Absent when the user declined.
The error Slack returned instead of a code (access_denied).
Defaults to the Slack workspace name. Other fields, such as an old
client’s redirect_uri, are ignored: the state carries the redirect.
Example generated
{ "state": "example", "code": "example", "error": "example", "friendly_name": "example"}Responses
Section titled “ Responses ”This workspace was already connected; its integration now has the new token
Slack integration added
Missing, foreign, expired or reused state; declined, expired or reused code; an org-wide install
Missing or invalid authentication
Not an admin, or not a dashboard session
Name over 256 characters
Slack could not be reached, or refused our app’s credentials
The credentials could not be sealed; nothing was saved, try again