I want to synchronize contacts in my application with Google contacts. But not all of them, just those with the right label (tag). I'm using Google's People Apis for this. But I ran into a problem, the memberships property/field which holds informations about labels is read only. I can't even create a contact/person with the right label. It throws an error. Is there a way how to update or create a contact with label?
For mor information head here.
EDIT:
I've tried both creating and updating a contact. Sending a POST and PATCH request message on https://people.googleapis.com/v1/people:createContact (similiar to update contact). Both fail with the same error, memberships parameter is read-only.
contactGroupId is the id of the label I'm trying to assaign to the contact.
Request body:
{
"memberships": [
{
"contactGroupMembership": {
"contactGroupId": "45asd3d7321gd"
}
}
]
... //Other parameters
}
You should use contactGroups.members.modify api call
Related
I have 5 users, they all look the same in Office 365 (from what I can see anyway) and have Teams Exploratory licences. I am able to create online meetings (OnlineMeetingProvider="teamsForBusiness" and IsOnlineMeeting=true) for 2 of them. For the other 3 users it doesn't error but doesn't create an online meeting (creates an event?), the response OnlineMeetingProvider is "unknown" and the OnlineMeeting is null. It is the same code so has to be a setting somewhere (all i do is change the id of the user).
The code used to create the request:
// Create client
var graphServiceClient = CreateGraphClient();
// Build event
var newEvent = new Event()
{
Subject = subject,
Body = new ItemBody() { ContentType = BodyType.Text, Content = body },
Start = startDate,
End = endDate,
IsOnlineMeeting = true,
Attendees = attendees == null ? null : GetAttendees(attendees),
OnlineMeetingProvider = OnlineMeetingProviderType.TeamsForBusiness
};
The erroneous response:
Anyone have any idea what is going on?
Had the same problem, I had to add these permissions to the app I was using to create the meeting events:
TeamSettings.Read.All, TeamSettings.ReadWrite.All
As soon as I added them, isOnlineMeeting was correctly set to true, and onlineMeetingProvider was set to teamsForBusiness, as specified in the request.
onlineMeetingUrl is always null, but it's possible to get the meeting url from the "onlineMeeting.joinUrl" property, which is automatically populated by the API.
UPDATE:
As #lokusking pointed out, even if this is correct, it looks like it does not completely solve the problem. According to my tests, creating a Team event for a new user and getting isOnlineMeeting=true and onlineMeeting properly populated in the response will work only a couple of hours after the user account is created. Note that even with a fresh user the event IS created, just those properties won't contain the right values.
You can change an existing event to make it available as an online meeting, by setting isOnlineMeeting to true, and onlineMeetingProvider to one of the online meeting providers supported by the parent calendar. The response includes the updated event with the corresponding online meeting information specified in the onlineMeeting property.
https://learn.microsoft.com/en-us/graph/outlook-calendar-online-meetings?tabs=http#example-update-a-meeting-to-make-it-available-as-an-online-meeting
Google forces us to migrate from the deprecated Contacts API over new People API.
They even implemented "Other Contacts" feature in the People API which was so demanded.
But now I'm facing another problem - there is no way to get photos of Other Contacts in the People API.
I was digging into this problem and figured out that it's possible to add photos into the readMask (even though it's not documented):
https://people.googleapis.com/v1/otherContacts?access_token=<...>&readMask=emailAddresses,names,photos
...but it doesn't help, because it returns the default picture with the first letter for all contacts, even for contacts who has a real photo. Like this one: https://lh3.googleusercontent.com/cm/ABXenNkcRSTRZU8PEFQfJtaeEBZnxLgN-UO555npUt1idzcMohoSGuJFfKx0JX2AR6Qp=s100
I tried to add coverPhotos into the readMask but it doesn't let it there.
Then I was checking how old Contacts API formats photo urls and figured out the format:
https://www.google.com/m8/feeds/photos/media/<user-email-address>/<contact-id>
But it has 2 disadvantages:
this url has to be requested with access_token
it works only if the contact uploaded a custom photo, otherwise it returns error
So here is my question:
Is there any simpler and cleaner way to get real photos of Other Contacts in People API?
This bug has been solved and now we have a solution!
Updated documentation: https://developers.google.com/people/api/rest/v1/otherContacts/list
There is a new sources[] request parameter. To get the real photos of "other contacts" you need to specify 2 values: READ_SOURCE_TYPE_CONTACT and READ_SOURCE_TYPE_PROFILE.
The request would look like this:
GET https://people.googleapis.com/v1/otherContacts?readMask=photos&key=API_KEY&sources=READ_SOURCE_TYPE_CONTACT&sources=READ_SOURCE_TYPE_PROFILE
Now some contacts will contain 2 entries in the photos array:
photos: [
{
metadata: {
primary: true,
source: {
type: "PROFILE",
id: "11111"
}
},
url: "<THIS IS THE REAL PROFILE PICTURE>"
},
{
metadata: {
source: {
type: "OTHER_CONTACT",
id: "6666666"
}
},
url: "<THIS IS THE DEFAULT PHOTO STUB>",
default: true
}
]
The readMask fields accepted for the otherContacts.list method are the following:
emailAddresses
metadata
names
phoneNumbers
photos
As you can notice, the photos field is an accepted one while making the above request.
However, the returned response should yield a url which redirects you to the user's profile picture. Because of this, I have taken the opportunity to report it on Google's Issue Tracker here. I suggest you star the issue as any updates regarding this will be posted there.
Reference
People API otherContacts.list;
People API Support.
I am using an access token with ZohoCRM.modules.custom.READ.
When I send a GET request to https://www.zohoapis.com/crm/v2/Custom/search, I get the following error.
{
"code": "INVALID_MODULE",
"details": {},
"message": "the module name given seems to be invalid",
"status": "error"
}
What am I doing wrong and how do I define the module I am trying to pull data from (it is called CustomModule2)?
Figured it out...
First, needed to go to https://crm.zoho.com/crm/{org_id}/settings/modules to find the actual name of CustomModule2 which is Adresses livraison.
Then, needed to go to https://crm.zoho.com/crm/{org_id}/settings/api/modules to find the API name for Adresses livraison which is Adresses_livraison.
Finally, needed to go to https://crm.zoho.com/crm/{org_id}/settings/api/modules/CustomModule2?step=FieldsList to find the API name of the field I wanted to use as a search criteria (it was Compte].
The final query using httpie is as follows.
http GET https://www.zohoapis.com/crm/v2/Adresses_livraison/search \
Authorization:"Zoho-oauthtoken {access_token}" \
criteria=="(Compte:equals:{account_id})"
Zoho is up there in the most awkward developer experiences I have encountered.
Just an update for anyone still looking into this, because I noticed that the links aren't always the same, depending on whether it's a sandbox or not, etc. So the steps are:
Go to your CRM page/dashboard and click on the Settings (cogwheel icon) on the top-right, next to your account image.
A bunch of items in panel boxes open. In the panel named "Developer Space" choose APIs
There it opens a bunch of tabs and sub-tabs and a Dashboard (As shown on the image below). The "Dashboard" sub-tab should be selected, all you have to do is switch to the sub-tab "API-Names"
I'm creating a new customer in stripe using a token created in the user's browser. This is on parse.com's servers, for what it's worth. I would like to retain a few details on the card, such as last4, but the customer object shows no sources under sources.data. Any pointers on how to get this information? Thanks for your help.
return Stripe.Customers.create({
source: token,
email: email
}).then(function(rr) {
console.log(rr.sources);
[ process response...]
});
This is the output:
{"object":"list","total_count":1,"has_more":false,"url":"/v1/customers/cus_[removed]/sources","data":[{}]}
It's bit strange that you are creating a customer but getting the object of customers list (https://stripe.com/docs/api/node#list_customers).
If customer is created successfully at stripe than it should return the customer object. You can check in more details here: https://stripe.com/docs/api/node#create_customer
I suggest here that please check the customer creation code once again at your side.
I need to get certain details for a user by his AD login ID.
Remember I just don't want to look into that user's contacts only. I want to look in global list and find the details (Similar details is shown when you double click the name of the person in the email message from, to, cc )
I found lot of links out there but they don't show any example for global search of user.
I tried to do something similar shown in this link
http://msdn.microsoft.com/en-us/library/jj220498(v=exchg.80).aspx
however it just within my own contacts.
Can anybody show a simple example or link for the same?
I found that ResolveName method does the trick. I can query by user's full name. I am just posting a method. I assume 'service' is already instantiated using proper domain/url/credentials
public Contact GetContactInfo(string sFullName)
{
Contact contact = null;
try
{
NameResolutionCollection allContacts = service.ResolveName(sFullName, ResolveNameSearchLocation.DirectoryOnly, true);
if (allContacts.Any())
{
contact = allContacts[0].Contact;
}
}
catch (Exception ex)
{
LogHelper.Error("Error in GetContactInfo(): ", ex);
//throw;
}
return contact;
}
Have you tried the ResolveName method?
http://msdn.microsoft.com/en-us/library/microsoft.exchange.webservices.data.exchangeservice.resolvename%28v=exchg.80%29.aspx
You can search the contacts folder and/or global address list with it. Make sure you set the boolean value to return the Contact with it.
I was looking for user's details and GetPersona is the operation.
Sharing with the concern that it may help others who are digging google & Microsoft to get user's information.
GetPersona operation
The GetPersona operation returns a set of properties that are associated with a persona.