Public image url from Google Gdata Contacts API - gdata-api

I'm trying to display related users through the Google GData Contacts API.
URL feedUrl = new URL("https://www.google.com/m8/feeds/contacts/default/full");
Query q = new Query(feedUrl);
q.setMaxResults(max);
q.setUpdatedMin(q.getUpdatedMin());
ContactFeed feed = client.query(q, ContactFeed.class);
for(ContactEntry item : feed.getEntries()){
[...]
}
I know that there is a public image url for profiles on Google.
https://www.google.com/s2/photos/profile/{user_id}
https://plus.google.com/s2/photos/profile/{user_id}
https://profiles.google.com/s2/photos/profile/{user_id}
However, when I retrieve a user's contacts, there just doesn't seem to be a field available to reference that user_id.

Related

Zoho creator integration with zoho books

So i recently started working with the Zoho platform so im quite new to it, ive been assigned the following task:
Build a Customer form on zoho creator with various different fields (name, company name, billing address and some extra custom fields.
Integrate the data from the form to the zoho books platform.
Basically, a user submit the form and on submission a new record on zoho books its created.
enter image description here
enter image description here
My issue, when the form is submitted theres no new customer on zoho books.
Can someone help me please
Thank You
cpList = List();
firstName = input.Contact_Name.first_name;
lastName = input.Contact_Name.last_name;
contactName = firstName + " " + lastName;
contactMap = Map();
contactMap.put("contact_name",contactName);
contactMap.put("company_name",input.Company_Name);
contactMap.put("website",input.Website);
billingMap = Map();
billingMap.put("zip",input.Billing_Address.postal_Code);
billingMap.put("country",input.Billing_Address.country);
billingMap.put("address",input.Billing_Address.address_line_1);
billingMap.put("street2",input.Billing_Address.address_line_2);
billingMap.put("city",input.Billing_Address.district_city);
billingMap.put("state",input.Billing_Address.state_province);
contactP = Map();
contactP.put("first_name",firstName);
contactP.put("last_name",lastName);
contactP.put("designation",input.Designation);
contactP.put("department",input.Department);
contactP.put("contact_salutation","Mr/Mrs");
contactP.put("mobile",input.Mobile_Phone);
contactP.put("phone",input.Phone_Number);
contactP.put("email",input.Email);
contactP.put("is_primary_contact",true);
contactMap.put("billing_address",billingMap);
cpList.add(contactP);
contactMap.put("contact_persons",cpList);
params = Map();
params.put("JSONString",contactMap);
createContact = invokeurl
[
url :"https://books.zoho.eu/api/v3/contacts?organization_id="
type :POST
parameters:params
connection:"books"
];
This was the way i was able to make it work.
There might need to be an authentication token for 'books' included in the headers. Check the books.zoho API documentation to see if there is information regarding creating and using an API token.
Also by adding detailed:true to the invokeurl call you can get some visibility into any information or error-messages in the response from invokeurl. Here is some example code:
response = invokeurl
[
url : "https://books.zoho.eu/api/v3/contacts?orgainization_id=20077348839
type :POST
parameters:datamap
connection:"books_contact_auth"
detailed:true
];
// To see all headers and content
info response;

Discover Google calendar created with service account

I created new Google calendar with API v3 in c# with Service account. I also set ACL rule:
var permission = new AclRule()
{
Scope = new AclRule.ScopeData() { Type = "domain", Value = "mydomain.com" },
Role = "reader",
};
Problem is how can users of domain "nicely" add this calendar to "Other calendars" in calendar.google.com site?
They can add it if they enter calendar id, which is not user friendly, since id is some random string:
4b123456789glvpvasaaaaaaaar4#group.calendar.google.com
. I though I could search by calendar summary. But this is not the case. Only entering complete calendarId adds it to calendar list.

How to get Facebook ID from the Parse User object

There are Parse user objects created through siging up with Facebook. How can I retrive the Facebook ID from these user objects?
As you can see the Parse User object has Facebook ID in the authData field.
You need to call Parse.Cloud.useMasterKey() before accessing authData.
Parse.Cloud.useMasterKey();
new Parse.Query(Parse.User).get(objectId).then(function(user) {
var authData = user.get("authData");
console.log(authData.facebook.id);
}
For more example, you can visit https://loginexample.parseapp.com/ which I built one month ago.

Get all contacts from exchange server

I want to get all users from Exchange server, I don't want to get user's contacts. In fact, I want to get all AD users as Active Directory which we can't connect to.
mExchangeService.ImpersonatedUserId = new ImpersonatedUserId
{
Id = "jack#aa.com",
IdType = ConnectingIdType.SmtpAddress
};
var contacts = _mExchangeService.FindItems(new FolderId(WellKnownFolderName.Contacts),new ItemView(1000));
I can above code to get user's contact, but that's not I want, I want use a service account to get all Exchange web service users.
You can sort of use EWS for retrieving your directory users using ExhangeService.ResolveName. The problem is that EWS will return no more than 100 users and there is no way to change it or to do any paging. So if you are in a larger company you can't really do it using EWS.
The code:
var nameResolutionCollection = service.ResolveName("SMTP:",
ResolveNameSearchLocation.DirectoryOnly, true);
foreach (var c in nameResolutionCollection)
{
Console.WriteLine(c.Mailbox.Address);
}
Console.WriteLine(nameResolutionCollection.Count()); // Maximum 100 users.

Google Calendar (API) questions

I'd like to use Google Calendar for adding party events, so I added a new calendar, "events". Is there a function for deleting all events in that calendar?
Or is it only possible by deleting the whole calender and re-creating it?
I'm having offline data which updates daily, so I thought the best method would be flushing the whole Google Calendar calendar and simply uploading all events.
This is helpful: Google Calendar .NET API documentation.
// Create a CalenderService and authenticate
CalendarService myService = new CalendarService("exampleCo-exampleApp-1");
myService.setUserCredentials("jo#gmail.com", "mypassword");
// Create the query object:
EventQuery query = new EventQuery();
query.Uri = new Uri("https://www.google.com/calendar/feeds/[calendar]/private/full");
where [calendar] = "jo#gmail.com" for default calendar or in your instance, the ID of your 'events' calendar (found in calendar in Gmail), that is, https://www.google.com/calendar/[calendarID]/private/full"
// Tell the service to query:
EventFeed calFeed = myService .Query(query);
// This should delete all items in your calendar
foreach(var item in calFeed.Entries) {
entry.Delete();
}

Resources