{"id":22782100,"url":"https://github.com/password123456/slackbridge-api","last_synced_at":"2025-10-12T22:17:51.695Z","repository":{"id":264090081,"uuid":"892333967","full_name":"password123456/slackbridge-api","owner":"password123456","description":"SlackBridge API is a Flask-based REST API designed for user management, email-based user search, and Slack message integration.","archived":false,"fork":false,"pushed_at":"2024-12-05T23:52:27.000Z","size":90,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-05T16:19:44.821Z","etag":null,"topics":["relay-api","relay-server","slack-api","slack-bot","slack-relay"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/password123456.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-21T23:17:51.000Z","updated_at":"2024-12-05T23:52:30.000Z","dependencies_parsed_at":"2024-11-22T00:22:48.365Z","dependency_job_id":"500560ec-af63-4033-93aa-c4dfad6e7229","html_url":"https://github.com/password123456/slackbridge-api","commit_stats":null,"previous_names":["password123456/slackbridge-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/password123456%2Fslackbridge-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/password123456%2Fslackbridge-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/password123456%2Fslackbridge-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/password123456%2Fslackbridge-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/password123456","download_url":"https://codeload.github.com/password123456/slackbridge-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246333931,"owners_count":20760638,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["relay-api","relay-server","slack-api","slack-bot","slack-relay"],"created_at":"2024-12-11T21:09:30.050Z","updated_at":"2025-10-12T22:17:46.651Z","avatar_url":"https://github.com/password123456.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SlackBridge API\n\n![made-with-python][made-with-python]\n![Python Versions][pyversion-button]\n![Hits][hits-button]\n\n[pyversion-button]: https://img.shields.io/pypi/pyversions/Markdown.svg\n[made-with-python]: https://img.shields.io/badge/Made%20with-Python-1f425f.svg\n[hits-button]: https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fpassword123456%2Fslackbridge-api\u0026count_bg=%2379C83D\u0026title_bg=%23555555\u0026icon=\u0026icon_color=%23E7E7E7\u0026title=hits\u0026edge_flat=false\n\nSlack Bridge API is a Flask-based REST API designed for user management, email-based user search, and Slack message integration.\n\nCurrently, this API only supports querying users and sending messages to users through a Slack bot. Features such as file attachments (e.g., images), sending messages to multiple users via the bot, sending messages to a specific channel (similar to a webhook), and responding to bot commands are not yet implemented. You can continue to modify and update the API as needed to include these features.\n\nIf you find this helpful, please the \"star\"🌟 to support further improvements.\n\n## Features  \n\n- **User Search:** Fetch user details by email or retrieve all users.  \n- **Health Check:** Validate server status with a lightweight endpoint.  \n- **Slack Message Integration:** Send Slack messages to `users/channels` via the Slack API.  \n\n## Project Structure  \n\n```plaintext\nslack_bridge\n├── settings.py\n├── wsgi.py\n├── token_generator.py\n├── service_config.py\n├── service_control.sh\n├── collect_slackusers.py\n├── collect_slackusers.sh\n├── requirements.txt\n└── app\n    ├── authentication.py\n    ├── exceptions.py\n    ├── generics.py\n    ├── logger.py\n    ├── route.py\n    ├── search.py\n    ├── sendmessage.py\n    ├── validators.py\n    └── db\n        ├── keys.db\n        └── users.db\n    └── logs\n        └── slack_bridge.app.validators.exceptions.log\n```\n\n## Getting Started\nTo start using SlackBridge API:\n\nClone the repository:\n```\ngit clone https://github.com/password123456/slackbridge-api.git\n```\nInstall dependencies:\n```\npip install -r requirements.txt\n```\n\n# API Endpoints\n  * [1.Send Message - Users](#1send-messages-to-users)\n    + [Request](#11request)\n    + [Response](#12response)\n  * [2.Send Message - Channels](#2send-messages-to-channels)\n    + [Request](#21request)\n    + [Response](#22response)\n  * [3.Retrieve User Data](#3retrieve-user-data)\n    + [Request](#31request)\n    + [Response](#32response)\n  * [4.List All Users](#4list-all-users)\n    + [Request](#41request)\n    + [Response](#42response)\n  * [5.Error Handling](#5error-handling)\n  * [6.Token Generator](#6token-generator)\n  * [7.Slack Bot Scopes](#7slack-bot-scopes)\n\n## 1.Send Messages To Users\n**Endpoint:** `/api/v1/messages/users`\n\n**Method**: `POST`\n\n**Description**\n- Sends a message to a specific Slack users.\n- Sends the message via a `Slack Bot`.\n- The size of a single message must not exceed the limit defined by the `verify_params_length` decorator.\n- The request body format is `JSON`.\n\n**Headers:**\n- `Authorization: \u003cAPI_TOKEN\u003e`\n- `Content-Type: application/json`\n\n**Body Parameters:**\n\n| **Name** | **Type**        | **Description**                                                                                              | **Required** |\n|----------|-----------------|--------------------------------------------------------------------------------------------------------------|--------------|\n| users    | `String`,`List` | Recipient's email address. The email format is validated by the `verify_params_suffix` decorator.            | Yes          |\n| message  | `String`        | The text message to send. Message must not exceed the limit defined by the `verify_params_length` decorator. | Yes          |\n\n### 1.1.Request:\n\n```\nPOST /api/v1/messages/users HTTP/1.1\nHost: slack-alim.example.com\nAuthorization: \u003capi_token\u003e\nContent-Type: application/json\n        \n{\n  \"users\": \"john.doe@example.com\",\n  \"message\": \"Hello John, Get Out!\"\n}\n```\n\n```\nPOST /api/v1/messages/users HTTP/1.1\nHost: slack-alim.example.com\nAuthorization: \u003capi_token\u003e\nContent-Type: application/json\n\n{\n  \"users\": [\"jane.doe@example.com\"],\n  \"message\": \"Hello, Jane\"\n}\n```\n\n```\nPOST /api/v1/messages/users HTTP/1.1\nHost: slack-alim.example.com\nAuthorization: \u003capi_token\u003e\nContent-Type: application/json\n\n{\n  \"users\": [\"john.doe@example.com\", \"jane.doe@example.com\", \"baby.doe@example.com\"],\n  \"message\": \"Hello, Guys\"\n}\n```\n\n### 1.2.Response:\n- Success (200):\n```\nHTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n  \"status\": true,\n  \"result\": {\n    \"users\": \"john.doe@example.com\",\n    \"message\": \"Message sent successfully, 2024-08-27T12:00:00Z\"\n}\n```\n\n```\nHTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n  \"status\": true,\n  \"result\": {\n    \"users\": [\n      \"john.doe@example.com\",\n      \"jane.doe@example.com\",\n      \"baby.doe@example.com\"\n    ],\n    \"message\": \"Message sent successfully! 2024-12-02T04:42:18+00:00\"\n  }\n}\n```\n\n\n- Error (400):\n```\nHTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n  \"status\": false,\n  \"error\": \"Required fields are missing in the request body. Please check and try again.\"\n}\n```\n\n## 2.Send Messages To Channels\n**Endpoint:** `/api/v1/messages/channels`\n\n**Method**: `POST`\n\n**Description**\n- Sends a message to a specific Slack Channels.\n- Sends the message via a `Slack Bot`.\n- `Slack Bot` must be joined the Channel\n- The size of a single message must not exceed the limit defined by the `verify_params_length` decorator.\n- The request body format is `JSON`.\n\n**Headers:**\n- `Authorization: \u003cAPI_TOKEN\u003e`\n- `Content-Type: application/json`\n\n**Body Parameters:**\n\n| **Name** | **Type**        | **Description**                                                                                              | **Required** |\n|----------|-----------------|--------------------------------------------------------------------------------------------------------------|--------------|\n| channels | `String`,`List` | Channel ids to Sending Message.                                                                              | Yes          |\n| message  | `String`        | The text message to send. Message must not exceed the limit defined by the `verify_params_length` decorator. | Yes          |\n\n### 2.1.Request:\n\n```\nPOST /api/v1/messages/channels HTTP/1.1\nHost: slack-alim.example.com\nAuthorization: \u003capi_token\u003e\nContent-Type: application/json\n        \n{\n  \"channels\": \"C0769GJ758U\",\n  \"message\": \"\u003c@U072E6GR1LM\u003e Hello John, Get Out!\"\n}\n```\n\n```\nPOST /api/v1/messages/channels HTTP/1.1\nHost: slack-alim.example.com\nAuthorization: \u003capi_token\u003e\nContent-Type: application/json\n\n{\n  \"channels\": [\"C0769GJ758U\"],\n  \"message\": \"Hello, Guys BE happy\"\n}\n```\n\n```\nPOST /api/v1/messages/channels HTTP/1.1\nHost: slack-alim.example.com\nAuthorization: \u003capi_token\u003e\nContent-Type: application/json\n\n{\n  \"channels\": [\"C0769GJ758U\",\"C06U8V03R0T\"],\n  \"message\": \"Hello, Guys BE happy\"\n}\n```\n\n### 2.2.Response:\n- Success (200):\n```\nHTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n  \"status\": true,\n  \"result\": [\n    {\n      \"status\": true,\n      \"channel\": \"C0769GJ758U\",\n      \"message\": \"Message sent successfully! 2024-12-05T08:48:17+00:00\"\n    }\n  ]\n}\n```\n\n```\nHTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n  \"status\": true,\n  \"result\": [\n    {\n      \"status\": true,\n      \"channel\": \"C0769GJ758U\",\n      \"message\": \"Message sent successfully! 2024-12-05T08:50:08+00:00\"\n    },\n    {\n      \"status\": true,\n      \"channel\": \"C06U8V03R0T\",\n      \"message\": \"Message sent successfully! 2024-12-05T08:50:09+00:00\"\n    }\n  ]\n}\n```\n\n- Error (400):\n```\nHTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n  \"status\": false,\n  \"error\": \"Required fields are missing in the request body. Please check and try again.\"\n}\n```\n\n## 3.Retrieve User Data\n**Endpoint**: `/api/v1/users/search`\n\n**Method:** `POST`\n\n**Description**\n- Retrieves information about a specific Slack user.\n- Returns the user's `email`, `username`, `display name`, and `Slack member_id`.\n- Time-related data in the response body follows the `ISO 8601` format (`YYYY-MM-DDTHH:MM:SSZ`).\n- Both the request and response body formats are in `JSON`.\n\n**Headers:**\n- `Authorization: \u003cAPI_TOKEN\u003e`\n- `Content-Type: application/json`\n\n**Body Parameters:**\n\n| **Name** | **Type** | **Description**                                                                                   | **Required** |\n|----------|----------|---------------------------------------------------------------------------------------------------|--------------|\n| user     | `String` | Recipient's email address. The email format is validated by the `verify_params_suffix` decorator. | Yes          |\n\n### 3.1.Request\n\n```\nPOST /api/v1/users/search HTTP/1.1\nHost: slack-alim.example.com\nAuthorization: \u003capi_token\u003e\nContent-Type: application/json\n\n{\n  \"user\": \"john.doe@example.com\",\n}\n```\n\n### 3.2.Response\n- Success (200):\n```\nHTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n  \"status\": true,\n  \"result\": {\n    \"datetime\": \"2024-11-22T10:09:14+09:00\",\n    \"real_name\": \"john.doe\",\n    \"display_name\": \"john\",\n    \"member_id\": \"U072E6GR1LM\",\n    \"user_email\": \"john.doe@example.com\"\n  }\n}\n```\n\n- Error (404):\n```\nHTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n  \"status\": false,\n  \"message\": \"The specified user could not be found. Please check the input and try again.\"\n}\n```\n\n## 4.List All Users\n**Endpoint:** `/api/v1/users/all`\n\n**Method:** `GET`\n\n**Description**\n- Retrieves information about all Slack users.\n- Returns the user's `email`, `username`, `display name`, and `Slack member_id`.\n- Time-related data in the response body follows the `ISO 8601` format (`YYYY-MM-DDTHH:MM:SSZ`).\n- Both the request and response body formats are in `JSON`.\n  \n**Headers:**\n- `Authorization: \u003cAPI_TOKEN\u003e`\n\n**Body Parameters:**\n- `None`\n\n### 4.1.Request\n```\nGET /api/v1/users/all HTTP/1.1\nHost: slack-alim.example.com\nAuthorization: \u003capi_token\u003e\n```\n\n### 4.2.Response\n- Success (200):\n```\nHTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n  \"status\": true,\n  \"message\": [\n    {\n      \"datetime\": \"2024-11-22T10:09:14+09:00\",\n      \"real_name\": \"john.doe\",\n      \"display_name\": \"john\",\n      \"member_id\": \"U072E6GR1LM\",\n      \"user_email\": \"john.doe@example.com\"\n    },\n    {\n      \"datetime\": \"2024-11-22T10:09:14+09:00\",\n      \"real_name\": \"jane.doe\",\n      \"display_name\": \"jane\",\n      \"member_id\": \"U092P6GRALM\",\n      \"user_email\": \"jane.doe@example.com\"\n    },\n    {\n      \"datetime\": \"2024-11-22T10:09:14+09:00\",\n      \"real_name\": \"baby.doe\",\n      \"display_name\": \"babybaby\",\n      \"member_id\": \"U132E6BR1LM\",\n      \"user_email\": \"baby.doe@example.com\"\n    }\n  ]\n}\n```\n\n## 5.Error Handling\nThe SlackBridge API uses standard HTTP response codes to indicate success or failure. Additional details are provided in the response body.\n\n| HTTP Code | Meaning               | Example                           |\n|-----------|-----------------------|-----------------------------------|\n| 200       | Success               | The request was successful.       |\n| 400       | Bad Request           | Invalid parameters were provided. |\n| 401       | Unauthorized          | Invalid or missing token.         |\n| 404       | Not Found             | The resource could not be found.  |\n| 500       | Internal Server Error | An error occurred on the server.  |\n\n## 6.Token Generator\n`token_generator.py` simplifies the creation, encryption, decryption, and validation of API tokens using `AES-GCM encryption`, ensuring high security and integrity. It is particularly useful for managing access keys with expiration and IP-based restrictions.\n\n### Features:\n- `Secure Token Management:` Generates encrypted tokens, stores them in a database, and retrieves them securely.\n- `Expiration \u0026 IP Validation:` Tokens include metadata such as issuer, expiration time, and allowed IP addresses for access control.\n- `AES-GCM Encryption:` Ensures confidentiality and integrity using a 32-byte passphrase key and a 12-byte nonce.\n\n## 7.Slack Bot Scopes\n- Below are the scopes required for creating a new Slack Bot.\n- The list also includes optional scopes that are not necessary (e.g., files:read, files:write).\n- Carefully review and grant scopes based on your specific use case and requirements.\n\nScopes does not allow Slackbots to send messages to arbitrary channels. To send messages to a channel, the Slackbot must be a member of the channel.\n\n| **OAuth Scope**          | **Description**                                                                      |\n|--------------------------|--------------------------------------------------------------------------------------|\n| `channels:history`       | View messages and other content in public channels that wawa has been added to       |\n| `channels:join`          | Join public channels in a workspace                                                  |\n| `channels:manage`        | Manage public channels that wawa has been added to and create new ones               |\n| `channels:read`          | View basic information about public channels in a workspace                          |\n| `channels:write.invites` | Invite members to public channels                                                    |\n| `chat:write`             | Send messages as @wa-bot                                                             |\n| `chat:write.customize`   | Send messages as @wa-bot with a customized username and avatar                       |\n| `chat:write.public`      | Send messages to channels @wa-bot isn't a member of                                  |\n| `files:read`             | View files shared in channels and conversations that wawa has been added to          |\n| `files:write`            | Upload, edit, and delete files as wawa                                               |\n| `groups:history`         | View messages and other content in private channels that wawa has been added to      |\n| `groups:read`            | View basic information about private channels that wawa has been added to            |\n| `groups:write`           | Manage private channels that wawa has been added to and create new ones              |\n| `groups:write.invites`   | Invite members to private channels                                                   |\n| `im:history`             | View messages and other content in direct messages that wawa has been added to       |\n| `im:read`                | View basic information about direct messages that wawa has been added to             |\n| `im:write`               | Start direct messages with people                                                    |\n| `incoming-webhook`       | Post messages to specific channels in Slack                                          |\n| `mpim:history`           | View messages and other content in group direct messages that wawa has been added to |\n| `mpim:read`              | View basic information about group direct messages that wawa has been added to       |\n| `mpim:write`             | Start group direct messages with people                                              |\n| `users.profile:read`     | View profile details about people in a workspace                                     |\n| `users:read`             | View people in a workspace                                                           |\n| `users:read.email`       | View email addresses of people in a workspace                                        |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpassword123456%2Fslackbridge-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpassword123456%2Fslackbridge-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpassword123456%2Fslackbridge-api/lists"}