How can i find my AccountId for my Zoho account? - zoho

Im trying to make some API calls for Zoho, like Email API.
But i am not able to make a valid request due to not knowing my Account Id.
Note that i know my User Id which i can find from my profile section in Zoho.
How can I find my Account Id?
Notes:
I tried calling this API, but getting an error.
http://mail.zoho.com/api/accounts
The error I get:
{"data":{"errorCode":"INVALID_TICKET","moreInfo":"Invalid ticket"},"status":{"code":400,"description":"Invalid Input"}}
Thanks!

Zoho's documentation explanation of account id:
"Each user might have more than just one account associated with their Zoho Mail account. They might have added several POP accounts that can be accessed from the Zoho Mail interface. Each account that you associate with a Zoho account will have a separate Account ID. You'll need the account ID while passing several user and account related API requests. The account ID for each account associated with a Zoho account can be retrieved using the Organization User Details API. You will need the OrgID to fetch the User account details using this API."
And the organization user details api mentioned is this
https://www.zoho.com/mail/help/api/get-org-users-details.html
And here you can see you get the account id
enter image description here

Related

How do I get a user's organization id when they login with Microsoft oauth?

I try to implement the microsoft auth into my application using Laravel Socialite, but since I'm working in a multi-tenant environment, I need to assign a user to a organisation. Is there anything such a microsoft organisation id or a domain name I can access in the docs? I'm unable to find it in the docs.
Also I try to get the street, postal and city and wasn't able to access that as well, but this is not as critical as the company identifier.
I found this thread, but it handles over Google, so maybe the approach might be similar:
How do I get a user's organization id when they login with Google oauth?
As I searched, I also found this docs, which seems to list all available fields of oauth: https://learn.microsoft.com/de-de/azure/active-directory/develop/id-tokens
https://learn.microsoft.com/en-us/graph/auth-v2-user#4-use-the-access-token-to-call-microsoft-graph
According to this docs: https://learn.microsoft.com/en-gb/previous-versions/azure/ad/graph/howto/azure-ad-graph-api-permission-scopes you can add tenant details to the request including the id, display name and verified domains.

Access entire gsuite domain calendar events

I want to access the entire events existing in a calendar of a gsuite domain. I tried using domain deligation with service account and it allows me to assume a user and get all of its events but i want to fetch the entire events in a gsuite account.
In order to achieve your task, you should create a service account which impersonates the admin of the domain.
Afterwards, you can retrieve the users of the domain by making use of the Admin SDK.
GET https://admin.googleapis.com/admin/directory/v1/users
Based on the list you get, you can get the events from the calendar of each user.
GET https://www.googleapis.com/calendar/v3/calendars/calendarId/events
Where, calendarId is the email of one of the users from the domain.
Reference
Admin SDK users.list;
Calendar API events.list.

How do I get a user's organization id when they login with Google oauth?

I'm using Laravel Socialite to handle logging in with Google. In response I can see the user's domain. I was wondering if there was also a way to get an organization id that's user belongs to.
I was wondering if there was also a way to get an organization id
that's user belongs to.
No. The only information that you have access to is stored in the Access Token and ID Token. The exception being if the Access Token also provides API access (privileges) to GCP or G Suite.
You'll need to request additional scopes to find the organization ID [1].
[1] https://cloud.google.com/resource-manager/reference/rest/v1/organizations/search

Get the Role, Grade,School name of Logged in user from Google API

I have integrated Google sign-in in our application, I need to check whether the logged in user is a teacher or student ,Organisation(school) name and Grade... Is there any API to get these details from Google and how to get the details form Google.
Regarding whether a user is a student or a teacher, see this answer.
It's not possible to determine the grade or school name via the Classroom API. (Please add a feature request for this so we can judge whether it's something a lot of developers would find useful!)

add calendar to another user's calendar list

Not sure if this is possible or if anyone has managed to do this. I have user with super admin access, with which I can create a new user for my domain. However I also want to add a couple of calenders to the created user's calendar list. When I create a user I authenticate using my super admin, but then I can't add a calendar to the user's calendar list since I am not logged in as the user. Is it possible to do this as the super admin, or do I have to logout and authenticate as the created user in order to add calendars to their list? This is the base url to which the post request is made:
https://www.googleapis.com/calendar/v3/users/me/calendarList
in the place of me could I pass in the id of the user? I couldn't find any parameter in the documentation with which I can specify the user to whose list I want to add a calender.
Thanks
Two options:
Each user much login to google calendar and share thier calendar to a single user. You can then use this account to update their calendars. Note that google has limitations to how many calendars and request you are allowed before the account goes to read-only mode.
Buy a google apps domain (5$per user per month) and create a service account at console.developers.google.com. Create a project and give it domain wide delgation at admin.google.com. In Apps engine you should be able to give access for admin to modify all users calendars.
No matter what case you choose, you also need to enable CalendarAPI at dev console site. Now with private key created from website request OAuth2 access token, where sub field is set for the users that you want to change calendar for. With returned access token use CalendarAPI to modify calendar.
Sry for bad english and short description, i'm in a hurry. /conner ;)

Resources