Create Slack integration mapping

post
https://api.box.com/2.0
/integration_mappings/slack

Creates a Slack integration mapping by mapping a Slack channel to a Box item.

You need Admin or Co-Admin role to use this endpoint.

Request

Bearer [ACCESS_TOKEN]
application/json

Request Body

objectin body

The schema for an integration mapping Box item object for type Slack

stringin bodyrequired
"1234567891"

ID of the mapped item (of type referenced in type)

stringin bodyrequired
"folder"

Type of the mapped item referenced in id

Value is always folder

objectin body

The schema for an integration mapping options object for Slack type.

true

Indicates whether or not channel member access to the underlying box item should be automatically managed. Depending on type of channel, access is managed through creating collaborations or shared links.

objectin body

The schema for an integration mapping mapped item object for type Slack

stringin bodyrequired
"C12378991223"

ID of the mapped item (of type referenced in type)

stringin bodyrequired
"channel"

Type of the mapped item referenced in id

Value is always channel

stringin bodyrequired
"E1234567"

ID of the Slack organization with which the item is associated

stringin bodyrequired
"T12352314"

ID of the Slack workspace with which the item is associated

Response

application/jsonIntegration mapping

Returns the created integration mapping.

application/jsonClient error

Returns a bad_request if an incorrect options was supplied or the Box folder cannot be mapped to this partner_item_id. Error codes:

  • SERVICE_ACCOUNT_IS_NOT_A_COOWNER_OR_OWNER - service account doesn't have co-owner collaboration or is not an owner of the box_item_id,
  • CHANNEL_ALREADY_MAPPED - channel is already mapped to another box_item_id,
  • CHANNEL_NOT_FOUND - channel was not found,
  • CHANNEL_NOT_SUITABLE_FOR_CFS - connect channel, not suitable for Box as Content layer for Slack,
  • BOX_ENTERPRISE_MISMATCH - Box folder must be owned by the enterprise, which is configured to use Box as Content layer for Slack,
  • CFS_DISABLED - Box as Content layer for Slack must be enabled for a provided Slack workspace or organization
  • BOX_FOLDER_EXTERNALLY_OWNED - Box folder must be internally owned to the admin's enterprise,
  • JWT_APP_NOT_AUTHORIZED - JWT authorization error.
application/jsonClient error

Returns a not_found error if the integration mapping could not be found.

application/jsonClient error

An unexpected client error.

post
Create Slack integration mapping
You can now try out some of our APIs live, right here in the documentation.
Log in

Request Example

Node
const mapping = await client.integrationMappings.createSlackIntegrationMapping({
	partner_item: {
		type: 'channel',
		id: 'C12378991223',
		slack_org_id: 'E1234567'
	},
	box_item: {
		id: '12345',
		type: 'folder',
	}
});
console.log(
    `Slack integration mapping with id ${mapping.id} was created`
);

Response Example

{
  "id": "12345",
  "type": "integration_mapping",
  "box_item": {
    "id": "12345",
    "type": "folder",
    "etag": "1",
    "name": "Contracts",
    "sequence_id": "3"
  },
  "created_at": "2012-12-12T10:53:43-08:00",
  "created_by": {
    "id": "11446498",
    "type": "user",
    "login": "ceo@example.com",
    "name": "Aaron Levie"
  },
  "integration_type": "slack",
  "is_manually_created": true,
  "modified_at": "2012-12-12T10:53:43-08:00",
  "modified_by": {
    "id": "11446498",
    "type": "user",
    "login": "ceo@example.com",
    "name": "Aaron Levie"
  },
  "options": {},
  "partner_item": {
    "id": "C12378991223",
    "type": "channel",
    "slack_org_id": "E1234567",
    "slack_workspace_id": "T12352314"
  }
}