Google People API Field parameter not working - google-api

There seems to be issue with the google people api.
If you go to the following link to test out the api,
https://developers.google.com/apis-explorer/#p/people/v1/people.people.connections.list
try:
GET https://people.googleapis.com/v1/people/me/connections?sortOrder=FIRST_NAME_ASCENDING&fields=connections(emailAddresses%2Cnames)&key={YOUR_API_KEY}
The results does not display the email address of the contact even thou it is specified in the fields.
Thanks,
Derek

You want to supply the requestMask parameter and ask for the email addresses and names explicitly:
This updated query should work:
https://people.googleapis.com/v1/people/me/connections?sortOrder=FIRST_NAME_ASCENDING&requestMask.includeField=person.emailAddresses,person.names&fields=connections(emailAddresses%2Cnames)&key={YOUR_API_KEY}

Related

Mentioning Guest using Slack Bot?

I have numerous guests in my channel.
I'd like my bot to mention these guests in a # mention, but bots don't seem to see channel guests. It find other full users fine, just none of the guests.
Is this an intentional limitation of Slack or does the bot require more permissions?
I'm using the slackclient module (Python) and making the following call:
sc.client.api_call(
"chat.postMessage",
channel="#channel",
link_names=1,
text="#aaron.layfield <-- Working #guest.name <-- Not working This is a message."
)
If you want to link to users from inside of your message, the best format to use is <#USERID> instead of #username. This is because Slack has moved away from using usernames, and towards a more flexible concept of display names, which aren't guaranteed to be unique or immutable.
So in this case, you would do something like
curl --request 'POST' 'https://slack.com/api/chat.postMessage?token=xoxb-21321321-1231321321321-dsfasdgdsfaghsdfhsdfh&channel=C9UFK5F5S&text=Hey <#UFBKH3B63>'
Which would render as
Hey #Colm Doyle
As already explained by Colm's answer the #username syntax is depreciated and you should use the ID syntax instead for mentions.
To get the IDs for your guest users call users.list to get a list of all users in your workspace. Then iterate through that list to match guest name with ID.

How to get Google Review by display name

I want to check if someone reviewed my business with its name. The user enters his google name and then I send a get request to check if the review exists. In the documentation it says I can get a review with this url
https://mybusiness.googleapis.com/v4/accounts/account_name/locations/location_name/reviews/review_name
I suppose accont_name and location_name are related to my My Business Account and I can find them somewhere there.
But what exactly is review_name? Is it the name of the Google Account who wrote the review? If yes what happens when two different Google Accounts with the same Name write a Review? Do I get two reviews back then? How can I tell which review is related to which account?
Review name is not the name of Google Account which has written the review, it means the 'reviewId' field that you get from the list of reviews. You have to pass it like below:
https://mybusiness.googleapis.com/v4/accounts/{account_name}/locations/{location_name}/reviews/{reviewId}
It will return to you the single review object.

How to get contact's "FreeBusyStatus" in Microsoft Outlook using REST Api?

See above mentioned image, it gives different status but don't know how to get it.
Check Outlook API.
Thanks in advance :-)
You can use GET https://outlook.office.com/api/v2.0/me/events/{event_id}?$select=ShowAs to retrieve the FreeBusyStatus of attendee(yourself) for a particular meeting, the return type is something like below,
If you want to check the response from a particular attendee, use GET https://outlook.office.com/api/v2.0/me/events/{event_id}?$select=ShowAs,Attendees, and check on the "Response" from the "Status" response.
This enumeration is used for 'Specifies the availability status of an attendee for a meeting.' At present, the Office 365 REST API is not able to retrieve the contacts' meetings status. And you can submit the feedback from here if you want to the Office 365 REST to support this feature.
We are able to add other’s users’ calendar manually, then we could see the status of the appoint/meet of him/her. Here is an figure that show the others calendar for your reference:
If you want to retrieve the free/busy information of EWS is a possible workaround. Please refer to here for more detail. And if you require these information to schedule a meeting, you can try to use the Find meeting times (preview).

Sending SMS from Twilio doesnt show friendly name on phone

When I send a test sms from https://www.twilio.com/user/account/developer-tools/api-explorer/message-create with a predefined friendly name, it doesnt apear on my phone. I only see the number.
-if this isnt possible, do you know other providers with this function that work?
[UPDATE]: Twilio now supports this feature.
You can now send messages from an alphanumeric sender ID using Twilio. I wrote up a blog post on how you can achieve this in Ruby and you can check out this article on how to get started with an alphanumeric sender ID on Twilio for more of an overview. Then check out the documentation on how to send an SMS message from an alphanumeric ID.
[UPDATE] Previous answer is below.
Twilio developer evangelist here.
You're absolutely right, the friendly name defined in your account is actually for your uses only and is not intended to appear in place of the number when sending an SMS. We have a few reasons for this, which might be interesting to you depending on your use case.
I don't have a particular company that I can recommend that does allow you to do this. A Google search might help though.

What on earth is this serial-number google is sending me?

I am using the google checkout api to process orders in an online store that i am building.
i ran into an issue today that i cannot move past! oi i am getting such a huge headache from this! So here is the problem:
when i send google an xml-based order, they send me back a grip of information that looks something like this:
<?xml version="1.0" encoding="UTF-8"?>
<checkout-redirect xmlns="http://checkout.google.com/schema/2"
serial-number="981283ea-c324-44bb-a10c-fc3b2eba5707">
<redirect-url>
https://checkout.google.com/view/buy?o=shoppingcart&shoppingcart=8572098456
</redirect-url>
</checkout-redirect>
I have been able to use this in the past, and i have just passed in <merchant-private-data> tags in my order request to specify unique orders. i just use the redirect-url above to send them to a page where they complete their order, and google sends me a notification with a serial-number. I pass back the serial-number along with my merchant_id and merchant_key and they send me back a bunch of xml with my order data.
I have already gotten my application working like this. the problem is that now i am trying to make my application so that you can plug in your google merchant id and key and my application will handle the order processing for you. the problem here is that when they send me the serial number in the notification, I don't know which merchant-key or merchant-id to send back to them. And now we have come full-circle to the basis of my question, which is this:
what is this serial-number that google is sending me??? it is definitely not the serial number that the notification api is sending me (unless i have to decode somehow?). Google gives no explanation in their documentation about this and all of the other questions regarding it can be answered by simply using merchant-private-data tags.
Please somebody! some wizard out there! Please help me!!!
The serial number is only relevant to a specific merchant - based on your post, you can equate this to a "specific callback api url" (in serial number notification).
If/when you ask a merchant to give you their mid/key, you'll have to provide them (merchant) the (unique) url they have to provide to Google.
So the "relationship" will be "mid/key/callback api url".
Hth.

Resources