Incoming Slack Webhook URL looks like https://hooks.slack.com/services/aaaaa/bbbbb/ccccc -- What is aaaaa, bbbbb, ccccc.. Can you please let us know is it possible to find what is the Slack Channel name and workspace name based on this webhook
Based on the incoming webhook alone (as a string) it's not possible, apart from the team_id mentioned in the comment above.
From my experience with only incoming-webhooks enabled and publicly distributed apps that information is available only in response after user installs the app with the standard OAuth process. Keep in mind that reponse will change depending of the scope of your application but if you ask for incoming-webhook you will get channel together with url which is incoming-webhook url. You will also get team_name and team_id which is Workspace info. You can find detailed explanation at https://api.slack.com/messaging/webhooks#incoming_webhooks_programmatic and https://api.slack.com/authentication/oauth-v2.
And here is an example of OAuth response json.
{
"ok": true,
"access_token": "xoxp-XXXXXXXX-XXXXXXXX-XXXXX",
"scope": "identify,bot,commands,incoming-webhook,chat:write:bot",
"user_id": "XXXXXXXX",
"team_name": "Your Workspace Name",
"team_id": "XXXXXXXX",
"incoming_webhook": {
"channel": "#channel-it-will-post-to",
"channel_id": "C05002EAE",
"configuration_url": "https://workspacename.slack.com/services/BXXXXX",
"url": "https://hooks.slack.com/TXXXXX/BXXXXX/XXXXXXXXXX"
}
So in the nutshell, as far as I know, there is no way to get information from webhook alone, but one other option, which is not directly the answer to the question is to expand your application and include web api permissions and then there is nothing stopping you to request that information independently from incoming-webhook directly from the workspace.
Related
To start, please keep in mind that I am not very experienced with coding and it would be greatly appreciated if any replies were made with clear instructions or links to resources that were fairly straight forward for a beginner.
With that out of the way, my current situation is that I need to move data automatically from a third party source into Quickbooks Online using Azure and I have very little idea how to set up the OAuth 2.0 connection to receive a valid token. I've done a test connection using Postman, successfully received a valid token, and have been able to send and receive data using the Quickbooks API. However, being able to do the same from inside of Azure (whether using AD or Logic Apps) escapes me. Please note that this needs to be a service-service connection with no user input required (e.g. no logins or prompts). I've tried setting up a GET request in Logic App to start the workflow to first receive the code by using the client_id, client_secret, and scope that is provided in the Quickbooks deverloper app keys section but it always comes back as permanently moved or a bad request. I think this is due to a bad URI but again, I'm not familiar with what URI I should be using in the GET request or even if the GET request is what I should be using in the first place. The next step of course would be to send the code and request the actual token.
My current research has only revealed information on authenticating to an AD app but all of the instructions seem to be mixing information from the old Azure platform making the process unusable. On the Quickbooks side, the information is all about creating Quickbooks apps for publication on their marketplace, which is not the goal here.
If anybody can help with this I'd appreciate it as I've spent the last couple of days trying to figure this out and getting nowhere.
{
"inputs": {
"method": "GET",
"uri": "xxxx", //This is what I need to know and where to find it
"headers": {
"client_id": "xxxx", //provided by quickbooks dev app
"client_secret": "xxxx", //provided by quickbooks dev app
"content-type": "application/json",
"scope": "com.intuit.quickbooks.accounting"
}
},
"recurrence": {
"frequency": "Minute",
"interval": 3
}
}
Error with current URI is "bad request" because it is missing api-version but could also be caused by the # symbol.
Currently we are in the process of developing one iPhone application that deals with google calendar. There was need of syncing calendar events to the server side. Everything works fine.
But for push notification , we are following this process
Whenever we post request to :
https://www.googleapis.com/calendar/v3/calendars/email#gmail.com/events/watch
with parameters
"id":Unique string ( channel id) ,
"type": "web_hook",
"address": "https://abc-api.herokuapp.com/user/notifications"
In the header , we are sending
Authorization : **Bearer 'Access_token'**
and content type : json
We already added domain as authorized domain in the google api console
Access_token is user's account access token .
We are getting "Unauthorized webhook call" error.
{
"error": {
"errors": [
{
"domain": "global",
"reason": "push.webhookUrlUnauthorized",
"message": "Unauthorized WebHook callback channel: https://abc-api.herokuapp.com/user/notifications"
}
],
"code": 401,
"message": "Unauthorized WebHook callback channel: https://abc-api.herokuapp.com/user/notifications"
}
}
Anyone here who can help us to solve the issue ?
You might want to check this post, providing solution like verifying if your domain have a valid (not self-signed) SSL license. Also in google-api-php-client GitHub, instead of setting https://example.com/google/push (resulted in Unauthorized WebHook callback channel) or https://www.example.com/google/push (allowed me to successfully open channel, and object has been returned, however webhook has not been fired) as address they tried https://www.example.com/google/push/index.php and worked.
One potential issue is if you're testing in Google's "try it" section of the documentation. It's not stated, but this particular request does not work there.
Otherwise, there are a few things that need to happen with the domain you are supplying in the address. First, you need to make sure its verified in the google developers console for the application you are hitting the api with. Additionally, you need to add the website property to your search console (even if its just an api) and verify ownership.
Also, once you get past the unauthorized address issue, you will get another error requiring a resourceId be supplied.
If you add any information to the description field of a google calendar (web) entry, it would be very useful to see a flag/mark/asterisk in the subject line. Then you can easily scroll through your event list or overview without double-clicking all records for (non-existent) details.
Is there an addon/plugin that will do this for me? Or do I have to program a chrome extension?
You can use Calendars:get by using this request, you were able to detect if the description of the calendar is empty or not.
Here's a sample request:
HTTP request
GET https://www.googleapis.com/calendar/v3/calendars/calendarId
Use calendarId to retrieve calendar IDs, call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the primary keyword.
Note that every request, your application sends to the Google Calendar API. Your request must include an authorization token. The token also identifies your application to Google. Your application must use OAuth 2.0 to authorize requests.
Successful Response include description as string:
{
"kind": "calendar#calendar",
"etag": etag,
"id": string,
"summary": string,
"description": string,
"location": string,
"timeZone": string
}
I am not sure where/how to set up a webhook in servicem8. I want to trigger an update when a Job status changes from Quote to Work Order.
I have read the documentation, but am not clear on the process.
Webhooks in ServiceM8 are only supported when using OAuth authentication using an access token, so you will need to register for a free developer account to get your OAuth Client Id and Secret. If you have not yet done so, follow the steps listed here:
http://developer.servicem8.com/docs/the-basics/public-applications/
Once you have OAuth authentication working, Subscribe to the 'Job' webhook to receive notifications when job data has changed. Do this by POSTing to https://api.servicem8.com/webhook_subscriptions
As mentioned on http://developer.servicem8.com/docs/platform-services/webhooks/ , the subscribe request should include:
object='job'
fields='status'
callback_url - Set this to the URL you wish to receive notifications
Once you subscribe to the webhook, you will immediately receive a request at your callback url to challenge you own this url. The request will contain URL parameters mode=subscribe, and a challenge value. To successfully confirm the challenge request you need to return a 200 result, with the body of the response set to the challenge code.
If you successfully confirm the challenge code request, you will start receiving notifications at your callback_url for any changes to job data within your ServiceM8 account. The notification you receive will contain JSON data similar to
{
"object": "job",
"entry": {
"changed_fields": ["status"],
"time": "2015-01-01 00:00:00",
"uuid": "de305d54-75b4-431b-adb2-eb6b9e546013"
},
"resource_url": "https://api.servicem8.com/api_1.0/job/de305d54-75b4-431b-adb2-eb6b9e546013.json"
}`
I used to get user image through this URL
https://plus.google.com/s2/photos/profile/(user_id)?sz=150
but now what all I am getting is 404 error or no image. I know google has changed its policies and way it connects and allows other to get information, but I didn't anything to achieve same result as above.
Note: I can't use authenticate thing here since I am showing image of users to other users which are not connected at all.
OR in other way user may be not coming from Google log-in but I need to show other Google users images only.
Any help would be highly appreciated!!!
Edit:
I have checked through people.get method
https://www.googleapis.com/plus/v1/people/11595...3592320?key=AIzaSyCkdmtNN1XDg....EpepOIIs
but I am getting error saying
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
}
],
"code": 403,
"message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
}
}
Edit: I have this already enabled since I am using Google+ log-in already in my site, here I am attaching screenshot:
Earlier I have also the same problem for my site after so much of research and efforts I found solution from my self and i hope that will also work for you and solve your problem:
Old Trick
Google had changed their policy so the old trick for getting the Google profile image will not work now.
e.g https://plus.google.com/s2/photos/profile/(user_id)?sz=150
New Trick
Get Request:
https://www.googleapis.com/plus/v1/people/115950284...320?fields=image&key={YOUR_API_KEY}
Response :200 OK
{
"image":
{
"url": "https://lh3.googleusercontent.com/-OkM...AANA/ltpH4BFZ2as/photo.jpg?sz=50"
}
}
Where YOUR_API_KEY is your Public API Access key which is generated through Credentials under APIs & Auth from https://console.developers.google.com/
And While creating Public API access key you can choose Referers URL's from which this request should be made but for checking you should try by not adding any URL to it, if it works then go with URL of your site.
You can choose other fields to send with URL which you may need from here.
Happy Coding!!!
You can get this information using the people.get Google+ API call and specifying the userid of the user you want information for. This will include an image.url field which you can use and resize as appropriate.
Since this is public information for a user, you don't need the user to authenticate to access it. You do, however, need an API Key which you will add to the end of the URL used in the API call.
You can get an API Key by going to https://console.developers.google.com/ under the "APIs and auth" section and "Credentials" subsection. You can then click on the button under "Public API Access" that says "Create New Key".
The URL you'll use to get the info will look something like
https://www.googleapis.com/plus/v1/people/1234567890?key=api_key
and you'll get back a JSON object with the profile info.
Update:
Make sure you have also enabled the Google+ API in the developes console. You can get to this through https://console.developers.google.com/, under the "APIs and auth" section and "API" subsection, you can find the "Google+ API" on the list and turn it on.