Phrazor SDK
Get API KeyPhrazor API
  • 👋Welcome
  • Docs
    • ⚡Quick Start
    • 🔑Get your API Key
    • Documentation
      • 📥Download and Import
      • 🔗Connect your Data
      • 🛠️Setup your Analysis
        • Descriptor
        • Change
        • Trend
        • Compare
        • Target vs Achievement
        • Budget vs Expense
        • Others
          • Filter your Data
      • 📋Generate your Insights
      • 📝Generate your Summary
      • 🔌Integrations
      • 💣Rate Limits
Powered by GitBook
On this page
  • Slack
  • Microsoft Teams
  • Google Chat
  1. Docs
  2. Documentation

Integrations

Discusses integration options and how to keep data up-to-date with refresh mechanisms.

PreviousGenerate your SummaryNextRate Limits

Last updated 1 year ago

Integrate with popular platforms like Slack, Microsoft Teams, Power BI, React Apps, and more

Slack

To integrate your output with Slack, you can use the Slack API and a library like slack-sdk for Python. Here's a basic code snippet to send a message to a Slack channel:

pip install slack-sdk

Next,you need to generate your Slack API token and then you can use the following code to send a message to a Slack channel:

from slack_sdk import WebClient
from slack_sdk.errors import SlackApiError

slack_token = 'YOUR_SLACK_API_TOKEN'
client = WebClient(token=slack_token)

# Define the Slack channel where you want to send the message
channel_id = '#phrzr'

# Output generated from Phrazor Layer
insights = <Phrazor Output>

try:
    response = client.chat_postMessage(channel=channel_id, text=insights)
    print("Insights sent successfully:", response['message']['text'])
except SlackApiError as e:
    print("Error sending insights to Slack:", e.response['error'])

To integrate your code's output with Microsoft Teams, you can use the Microsoft Teams Incoming Webhook feature. Here's a simple code snippet to send a message to a Microsoft Teams channel:

First, configure a new Incoming Webhook in Microsoft Teams and generate a webhook URL.

Next, install the requests library which will be used to send messages to the webhook URL.

pip install requests

Then, use the following code to send a message to Microsoft Teams.

import requests
import json

# Define the webhook URL provided by Microsoft Teams
webhook_url = 'YOUR_WEBHOOK_URL'

# Your message payload
insights = {
    'text': <Phrazor Output>,
    'title': 'Phrazor'
}

# Send the message to Microsoft Teams
response = requests.post(webhook_url, json=insights)

# Verify the response
if response.status_code == 200:
    print("Insights sent successfully.")
else:
    print("Error sending insights:", response.status_code, response.text)

To integrate your code with Google Chat, you can use Google Chat's incoming webhook feature.

First, configure a new incoming webhook and generate a new Webhook URL.

Next, install the requests library which will be used to send messages to the webhook URL.

pip install requests

Then, use the following code to send a message to Google Chat.

import requests
import json

# Define the webhook URL provided by Google Chat
webhook_url = 'YOUR_WEBHOOK_URL'

insights = {
    "text": <Phrazor Output>
}

# Send the message to Google Chat
headers = {'Content-Type': 'application/json; charset=UTF-8'}
response = requests.post(webhook_url, data=json.dumps(insights), headers=headers)

# Verify the response
if response.status_code == 200:
    print("Insights sent successfully.")
else:
    print("Error sending insights:", response.status_code, response.text)

Similarly, we can integrate the output from Phrazor into any downstream application easily.

Microsoft Teams

Google Chat

🔌