Background
I'm creating an app that will allow me to send meeting points to my clients by SMS. The meeting points are always physical addresses, not coordinates. When doing the process manually through Google Maps, it looks like so:
Note that the link generated is a goo.gl. Also, note the neatly generated thumbnail, displaying the facade of the house and the address under it. Very user friendly.
My problem
Trying to recreate the step above programmatically works only partially; it creates a workable link but the SMS does not display the facade picture of the house, nor is the address displayed below the thumbnail.
Most inquiries I found on the topic point to Google's Developer Guide, where they make use of the following synthax:
https://www.google.com/maps/search/?api=1&query={{URL encoded address}}
or in this situation:
https://www.google.com/maps/search/?api=1&query=172+Fourth+Ave+Ottawa%2C+ON+K1S+2L6
Following the approach above yields the following SMS:
Any suggestion on how to get the first output generated via goo.gl link?
I have the Google Picker API implemented in an application, with the Google Drive view included. Currently, entering a search query in the search bar of the Google Drive view starts showing a drop-down with some file results included, like this:
search bar drop down
However, clicking the "magnifying glass" search button, or pressing enter, or clicking "search for all items containing...", all results in an empty picker, like this:
empty picker with no search results
I believe this is occurring because a call to https://docs.google.com/picker/pvr is returning this error as a response every time: &&&START&&&{"error":true,"errorMessage":"Internal error"}.
The parameters being sent to that /pvr endpoint are here:
start: 0
numResults: 50
sort: 3
desc: true
q: testing
cursor:
mine: 2
service: docs
type: NOT_COLLECTION
options: {"ff":true,"filterTeamDriveResults":true}
token: J********
version: 4
app: 2
clientUser: 1************
developerKey: A*************
subapp: 5
What I found is that manually removing the "filterTeamDriveResults":true key from the "options" hash and doing an ajax post directly resulted in a successful request, but for whatever reason that option is included with every request from the picker, and any time a request is made with that option included, it seems to fail with the same "Internal error" response. I'm wondering what the source of that option is, and if there's any way to remove it from our picker. As far as I can tell it doesn't seem to be controlled by any of the options in the JavaScript API that we're loading from https://apis.google.com/js/api.js?onload=onApiLoad.
This started happening to us last week as well after having been using the Google Picker API for years without any issues. Your clue about the filterTeamDriveResults key reminded me of something I had just read, about upcoming changes to the Google Drive API and Google Picker API:
Next, we’re introducing a new Drive API resource collection, called “Drives,” to replace the “Team Drives” resource collection. This new resource collection can help you create, delete, get, list and update your shared drives, and features all the same fields, resources and available methods as the “Team Drives” resource collection. If you have been using the “Team Drives” resource collection in your applications, consider migrating as soon as possible as all related fields for Drive API , Drive Activity API and Google Picker API, will no longer be supported starting June 1, 2020.
It doesn't seem related, at least not directly, but made me think that perhaps, the SUPPORT_DRIVES feature that I had seen here in the docs, could "disable" that other teamDrive feature (even though it's not really that, but still...). And indeed, that fixed it. Basically just:
new google.picker.PickerBuilder().
setAppId(appId).
addView(new google.picker.DocsView().setIncludeFolders(true)).
enableFeature(google.picker.Feature.SUPPORT_DRIVES)
...
One thing to notice is this warning when enabling this feature:
Before enabling this make sure to refer to Google Drive API documentation for enabling shared drives and make any necessary Drive Rest API changes.
Might be relevant in your case.
I have successfully added JSON code to my job listings so they now appear on Google Jobs.
The problem is many of the URLs for the jobs have incorrect wildcard subdomains such as:
https://mail.mywebsite.com
https://ww.mywebsite.com
Wildcards/subdomains are not covered by my SSL certificate, so when you click these links a warning page appears to say that the website has been improperly configured and to proceed with caution.
It seems to be picking these wildcard URLs up from Google search results instead of taking the URL of the actual page. I have added the 'URL' property to the code but it seems to ignore it.
Is there another property I can add to the JSON code to get Google to use the proper URL?
We are trying to setup deep linking into slack, as described here:
https://api.slack.com/docs/deep-linking
The document states that to open a specific team, the following URL should be used:
slack://open?team={TEAM_ID}
Open Slack and switch teams to the specified team. The provided
TEAM_ID should be a string, like T12345.
Furthermore, to open a channel in a team, the following URL should be used:
slack://channel?team={TEAM_ID}&id={CHANNEL_ID}
Open the channel specified by the CHANNEL_ID provided in the id field,
like C024BE91L. You must also specify the team with a TEAM_ID.
My question is simple. Where can I find out what TEAM_ID I need and what CHANNEL_ID I need?
Here is the easiest way to manually find the slack IDs
1. Any channel ID
Open the slack webpage (http://yourteam.slack.com) and then simply open the channel. The channel ID is displayed in the browser URL:
2. Any user ID
To find a user ID you need to open your browser dev-tools console and inspect the user-link in the sidebar. The user ID can be found in the HTML attribute "data-member-id":
Or in slack: (1) Click on the users name and choose (2) "Show Profile". Then open the "..." menu and you see the option (3) "Copy Member-ID ..." - to get your own user ID via the UI, you have to click the Team-Logo in top-left corner and then choose "Profile & Account" (this is not included in the screenshot)
3. Team ID
Simply open the dev-tools of your browser, switch to the "Console" tab and enter the text boot_data.team_id into the console. This will display your team ID:
As of July 2019, it seems like the team id and the channel id is already being shown via the web.
As you can see in the screenshot, the 2nd to the last node is the team id (prefixed with "T") and the last node is the channel id (prefixed with "C"). All you have to do is open slack via the web, go to the specific channel, and you can see the url change to something close to the screenshot above.
Slightly different answer to the existing ones.
Whenever I wanted to just find out quickly what the relevant ids are for a specific team, I just opened the Slack web client and inspected the relevant elements. (Using Chrome Dev Tools)
https://my.slack.com/messages
The <a> tag that links to a user tends to include a data-member-id attribute, the content of which is the user id.
The same holds true for channels. If you inspect any of the channels in the sidebar, you can see they are ordered as <li> list elements each containing the channel id in the class name.
For the team id, you can open the entire source of the slack web client and CTRL-F for your team_domain (e.g. myslack55 for myslack55.slack.com) and that should find you the team id.
Basically, it's all hidden in plain sight. You just need to know where to look ;)
The answer marked correct here does not work for me, but I may have found an even easier way with test tokens.
Create a test token: https://api.slack.com/docs/oauth-test-tokens
Scroll down to the "try it now!" button. You land on auth.test: https://api.slack.com/methods/auth.test/test
Choose the team you want to test and click Test Method. You can find your team_id (and user_id) there.
Do the same for channels.list. You can click "View Another Method" and search or go to: https://api.slack.com/methods/channels.list/test
Choose the team again and Test Method. Cmd+F through the channels object looking for whatever channel_ids you need.
The easiest way to get the team and channel id and is to add slack developer tool app to your slack, you can can it here.
After adding it all you simply need to do is go to any channel and choose this command
/sdt whoami
It will output a snippet like this one.
There are much more commands and other things you can perform with this slack app, I would highly recommend it if you're building any integrations for slack.
As of 2017, it looks like slack made it easier to find.
Here is the easiest way to manually find the Team IDs.
Visit your slack room via a web browser.
Right Click > "View Source"
And search for Team_id:
If you are using the Slack app you can simply right click on the channel name in the left menu and click Copy link, paste it somewhere and you will see the channel id.
You can also simply right-click on the slack channel (or direct message) in the desktop App and select the 'Copy Link' option.
This will give you a URL of the form: https://org.slack.com/messages/[channel-ID]
I attest this works on High Sierra Mac OSX - Slack 3.1.1
Team ID
The easiest way to get your team ID is to use the Slack API method auth.test with your access token.
Channel ID
Depends on if you want a public or private channel you can call the respective Slack API method to get a list of all channels incl. their IDs.
Public channel: channels.list
Private channel: groups.list
Note that you can only see private channels in which the user/bot that belongs to your access token has been invited into.
Accesss Token
To get the access token you can either request a "test token" on the Slack API page under "Test Token" (only recommended for testing purposes by Slack). Or you can create a Slack app and install that app for your Slack team using Oath which will also generate an app specific access token.
If you've come here looking for how to access these values via the API for a specific user (like me!) using the #slack/bolt package - here's an example of how to do it.
Team ID & Channel ID & User ID
app.message('hello'),
async ({ say, body, context, message }) => {
const teamResponse: any = await app.client.team.info({
token: context.botToken,
user: message.id,
});
// An object containing the team data that Slack has stored
const team: SlackGeneratedTeam = teamResponse.team;
// User ID
console.log(message.id)
// Team ID
console.log(team.id)
// channel ID
console.log(message.channel)
})
I have created created How to a new web app integration with the help of this documentation of Box api documentation.
When i right click on a pdf file i can see my application.
Now i need to know how to configure my application to get the file id?
I believe what you're looking for is the "Callback Parameters" section of your Web App Integration.
Within the Callback Parameters section you can choose whether what your application is expecting is a GET or POST request or a file object (in cases where you would like the file itself to be sent to your application) and input a parameter name that you would like to receive for the value. Then you can click into the box for Parameter Value to see a dropdown of the available parameters that can be sent to your application with a short description of what each one returns. The one you're looking for in this case is the file_id, which will show up as #file_id# once you click it, as in the screenshot provided.