Sumologic sending alerts to SLACK - slack

I tried to send alerts from Sumologic to Slack. But when I test the connection, it always failed and return 400 http code. I used the connection type as Webhook
When test the connection, it should pass

If you are using WebHook and testing the connection, you must use a valid payload. If you don't provide a valid payload, the connection test will not succeed.
You can use the connection type as SLACK over WebHook. Still, you are using a webhook URL.
This link shows how to integrate Sumologic with Slack.
https://www.youtube.com/watch?v=qEz8dcp9SgI

Related

In a group chat, should the new message event (websocket) be sent by the client or the API?

I have a doubt, in a group chat system that has a database with a rest API, who should issue the event of a new message?
The client or the endpoint to create the new message?
For example: X user sends a message to group Y, then uses the api endpoint api.com/message-create and that endpoint emits the message-create event through websocket
Example 2: X user sends a message to group Y, then uses the api api.com/message-create endpoint and the endpoint does not emit the message-create event, but was emitted when the user pressed the send message button
I still don't quite understand if it would occupy more websocket channels to achieve that, if a global one is enough, etc.
The server should be responsible for communication logic. So your first example is better.
But: why do you use two communication channels for sending an creating messages?
If you use websocket, you don't need create a message from a client by using additional rest endpoint.
This approach is prone to errors. For example if the client will loose network connection after sending message through websocket and before executing call to the REST endpoint?
The message will not be stored in a database.
Your flow should looks as follows:
User clicks the send button.
Message is send through the websocket.
Message is stored in the database asynchronously (you can do it directly from communication server, or use rest endpoint)
Emit "new message" event to the group.

How do I retrieve the sender number when using Twilio's messaging services with Copilot enabled?

I have a Twilio messaging service with Copilot and the sticky sender feature enabled.
I would like to view the phone number that Copilot assigns to my recipients when I send them a message.
With the Ruby client, I get a MessageContext object when I send a message, but it only has the
messaging service SID - the from method returns nil.
Currently, this is how I'm sending messages:
def send(from, to, message)
client = Twilio::REST::Client.new(ACCOUNT_SID, AUTH_TOKEN)
client.api.account.messages.create(
body: message,
messaging_service_sid: from,
to: to,
status_callback: BASE_URL + '/sms_status/status',
)
end
Twilio developer evangelist here.
I'm not sure, but you might not have the phone number at the time you make the API request using a messaging service. This request really just queues up the message to be sent.
I would check the message object once it has been sent. You have a status callback URL setup, so you should be able to either inspect the parameters sent to that URL or look up the message from the API using its SID and then get the number that was used.

SonarQube doesn't send notification to Discord webhook

I want notification on my discord app after completing every scan in sonarqube. I have tried to configured my discord webhook URL in sonarqube webhook option but it getting 400 error code after scanning the code and not sending notification.
Steps i tried :
Created webhook URL from my discord chennel.
Configured that webhook URL in sonarqube > Administration > Configuration > Webhooks.
Run code scan So that it send notification to configured webhook.
But i am getting below error.
Error :
Last delivery of Spidey Bot
Response: 400
Duration: 186ms
Payload: .....
Discord webohook screenshot attached
SonarQube Error screenshot attached
It turns out, request body format which SonarQube sends to Discord is not acceptable. It leads to bad request error. Below is logged response from Discord,
{
"message": "Cannot send an empty message",
"code": 50006
}
To successfully post the message it must be in the specific format documented https://discordapp.com/developers/docs/resources/webhook#execute-webhook
The solution to this could be a mediatory URL which parses the request body and hits Discord Webhook with excepted body params.

How to customize error message sent to an end-user when bot's endpoint is unavailable?

If a user sends message to a bot while it's endpoint is unavailable or failed processing the message, the user receives an error message from Bot Connector, which seems like that:
POST to {SomeArbitraryBot} failed: POST to the bot's endpoint failed with HTTP status 502
or
POST to {SomeArbitraryBot} failed: A task was canceled.
etc.
Is there a way to customize logic of sending error message or to suppress it at all in such a case?
UPDATE
I posted a corresponding issue at Bot Builder GitHub repository.

Shopify webhook verification in parse

I am trying to get a shopify webhook to fill my customer class in parse.com, however something must go wrong. I don't know how to verify the parse response since Shopify sends this webhook out from it's ruby backend. I used requestbin to catch the webhook and I replicated a post request using postman to my parse url and everything works fine. Does anyone know how to debug requests like these? Is there a console in Parse where I can see all the incoming requests and the responses Parse.com sent back?
Try using Runscope for debugging webhooks. Full guide here: https://www.runscope.com/provider-guide/troubleshooting-webhooks - this is more than just a request bin. It's a full transparent proxy that will, like a bin, record the webhook notification, but will also pass it along to the intended destination (your webhook receiver) and record that response as well.

Resources