This must be completely obvious and I am sure I am missing something here but here it goes:
according to slack documentation :
curl -X POST -H 'Content-type: application/json' \
--data '{"text":"This is a line of text.\nAnd this is another one."}' \
https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
but where do I find my account specific parameters to go in here :
T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
According to this page https://www.programmableweb.com/news/how-to-integrate-webhooks-slack-api/how-to/2015/10/20
You get that URL by clicking "Add Incoming Webhook Integration"
When you're done doing whatever it needs, it gives you the URL you need to post to. It's a bit different than using an API token.
As has already been pointed out this is an incoming webhook, which is an easy way to post messages to Slack. The full URL is arbitrary and will be automatically generated for your as soon as you have created the webhook for your Slack team
On the official documentation page about incoming webhooks I am guessing you missed the link in the 2nd paragraph ;-)
"Start by setting up an incoming webhook integration...".
Just click the link to set up your webhook.
Related
I'm working on an MFA implementation with Twilio Verify and a C# library in my pet project. So, the question is, can I verify that the message was delivered? There are strange cases when I try to send a message, I don't get any exceptions, but the message delivery status is unknown, and I don't get it on my mobile phone. Here is an example:
I found a solution using webhook, but it fits very poorly into the current architecture of the project. So I wanted to know if there is any way to get records about the messages which are shown in Verify service logs and check their delivery status with something like a simple API call.
Once you created a verification you can fetch the verification using:
curl -X GET 'https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Verifications/VEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
The response includes a status and a carrier section with potential error codes.
Playing around with a dummy facebook app nd ruby on rails to set-up a messenger bot. My goal is to trigger a sign up when the user first interacts with the bot by clicking the default 'Get Started" button. I have added a get started button this way:
curl -X POST -H "Content-Type: application/json" -d '{
"get_started":{
"payload":"GET_STARTED_PAYLOAD"
}
}' "https://graph.facebook.com/v2.6/me/messenger_profile?access_token=TOKEN
Then received:
{"result":"success"}
By looking at my server logs, I notice I dont get any callback from the user action. I know the webhook is set correctly cause other bot features seems to work right. So here is my question: I use pages_messaging permission on facebook apps, I think the reason why might be I need pages_messaging_subscriptions in order to get back that data. Can this difference explains why I don't get back any data on user clicking Get started?
Any help appreciated
I want to give the user updates from my app by creating a channel in his team. So I want to do 2 thing:
create a channel (e.g #coolapp) for my user (in his slack team)
send all update from my app to that coolapp channel
Thanks for stoping by.
To create a channel you need (at a minimum) the channels:write scope (https://api.slack.com/docs/oauth-scopes) which I doubt your client will grant. The best and easiest thing to do is to create a custom integration with the incoming-webhook scope which allows you to post messages to a channel selected by the user (not by you). The customer can install your custom integration (app) using a Slack Button and if you set it up correctly with an incoming-webhook; then when they install the app, they will select which channel your messages will post to.
This is all explained in more detail here.
Posting messages to the channel via the webhook is then really simple. From the docs:
curl -X POST \
--data-urlencode 'payload={"text":"This is a line of text.\nAnd this is another one."}' \
https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
I know how to capture information about SMS messages going to my Twilio number by making use of their Message Request URL facility.
However, this facility only seems to capture info about SMS messages going to my Twilio phone number.
Is there some way to send an SMS message from my Twilio phone number and also have it logged in the same way via the same Message Request URL?
For example, I know I can do the following to send an SMS from my Twilio phone number ...
#!/bin/sh
sid='XXXXXXXXXXXXXXXX'
token='YYYYYYYYYYYYYYYY'
from='12125551212' # assume this is my Twilio phone number
to='9999999999'
text='Now is the time for all good men to come to the aid of their party.'
/usr/bin/curl \
-X POST https://api.twilio.com/2010-04-01/Accounts/${sid}/Messages \
-u "${sid}:${token}" -d "From=${from}" -d "To=${to}" \
--data-urlencode "Body=${text}"
However, this message does not get logged via my Message Request URL.
I know that I can put a wrapper around this and make an additional direct call to curl which will also post to my Message Request URL using similar parameters to what Twilio uses in the SMS-from-someone-else-to-Twilio case.
However, is there some way to get Twilio to automatically notify my Message Request URL of these Twilio-to-someone-else SMS's? ... perhaps via extra parameters to the POST request?
Thank you very much in advance.
Twilio evangelist here.
You could specify the StatusCallback parameter in your cURL request. This will have Twilio make a request to that URL once your message is processed.
Hope that helps.
How can I create a Zendesk ticket with a subject using a URL?
We have a customer support center using Zendesk. We also have a VoIP phone system that can fire off a URL when a call comes in. I understand that using the Zendesk API I can create tickets, but to do that I need to authenticate using JSON. My VoIP system doesn't have that option so I would have to build a web app that takes in a URL and converts it in to a secure JSON connection. Instead, I'd like to have our agents logged in to Zendesk and then have the phones launch a simple URL with the caller ID upon incoming call.
In Zendesk I see this URL:
https://mydomain.zendesk.com/agent/#/tickets/new/1
But I haven't found any documentation regarding adding a subject and/or description.
What URL can I use to create a new Zendesk ticket and supply arguments (using a GET request) to fill out the subject and/or message?
In general, it isn't possible with a GET request. Their API requires POST http://developer.zendesk.com/documentation/rest_api/tickets.html#creating-tickets
What I would do is host a server/application on a network server that has a simple API - django has simple URL parsing. The phone would create a URL like this yourinternaldomain.org/ticketspawner/create/[number]/name/[caller_id_name]
The app parses [number] and [caller_id_name] from the URL and can create a new ticket based on the phone number and caller_id_name (perhaps you want to create the user first). You can use python or curl or whatever you like.
From their page:
curl https://{subdomain}.zendesk.com/api/v2/tickets.json \
-d '{"ticket":{"requester":{"name":"The Customer", "email":"thecustomer#domain.com"},
"submitter_id":410989, "subject":"My printer is on fire!", "comment": { "body":
"The smoke is very colorful." }}}' \
-H "Content-Type: application/json" -v -u {email_address}:{password} -X POST