Google Group - Clone or back up a group on admin console - google-apps-script

We have a large emergency notification list (Google group) consisting of 75000 members. The membership of this group is maintained through a daily sync with enterprise identity management tables using GSuite Admin SDK - Group Settings API. Can anybody suggest an easy way to create a backup group for this list directly on Google Admin console. If the original list lost its membership it took 14 hours to bring the list up via API. Hence the need for a backup group. This backup google group must be ready to send the emergency alert message in case some thing happened to original group membership during daily sync.

Related

How can I check student attendance in recurring google meet's?

I want to check the students attendance for all google classroom courses. As the meeting_code will be the same for each course (recurring), how can I figure out the attendance for each meeting? Which parameter can help me to solve that? Any ideas?
Thanks
Yes, you can if you are an admin
From the user interface, go to the Admin console and go to Reports -> Audit log -> Google Meet. You can filter the results by start time, user name etc.
In Apps Script you need to enable and use the Advanced Service Admin Reports API.
More specific, you need to use the method Activities:list, specifying the student of itnerest as userKey and meet as applicationName
You can filter by different parameters as specified for the Google Meet Audit Activity Events, like startTime of the meeting, or e.g.
duration_seconds whihc not only allows you to estimate either a student participated, but also for how long he did.
I recommend you to test the request with the Try this API feature before implementing it into Apps Script

Programmatically fetch user's last login date to G Suite

On a user's page on the G Suite admin console, an admin can see the last login of a user. For example, one user I can see has a "last login" date of two years ago.
I'm trying to pull this date programatically. However, the Reports API that provides information on login events only goes back 180 days. How is Google getting this login date, and can it be fetched via API?
Google has this information because they are logging the event when it happens and storing that to present in the admin console. If you start to build an application now and start storing those events as time passes you too will have a date that goes back years. G Suite Enterprise customers can seamlessly do this if they Set up BigQuery logs in the Admin console.
You should be able to get this information now though. Look at the following APIs used in GAMADV-XTD you can get this info with this command for example.
gam report users parameters accounts:last_login_time filters "accounts:last_login_time<#filtertime#" filtertime -5y
https://developers.google.com/admin-sdk/reports/v1/reference/activities
https://developers.google.com/admin-sdk/reports/v1/reference/customerUsageReports
https://developers.google.com/admin-sdk/reports/v1/reference/userUsageReport
I somehow missed this before, but you can get the last login date/time with the User Usage Report (rather than the Login Activity report).
API docs are here and the App Script example I'm using is here. I realized that if GAM was pulling the information there had to be an API for it.

Working with multiple facebook apps user id v1.0 and v2.0

We're using multiple Facebook apps for our product, in V1.0 we used to get the same user id for all apps. We save accounts collection in our db in which we save Facebook id in and creating new accounts for users in which we don't have their FB id already.
Last week we've created a new app, when we started to use it we found out that we're getting a different id for existing users and we're creating a new account for them in our db. (This happened because the new app was created on v2.0 as explained here - https://developers.facebook.com/docs/apps/upgrading#upgrading_v2_0_user_ids)
I read that we can use business manager in order to define all apps and get all the user id for all apps under the same business (https://developers.facebook.com/docs/apps/for-business), but I couldn't find how can I connect these ids to the original id.
I saw a hack that once I have app_scoped_id, I can make a another FB api call to get the original id (Get Facebook User ID from app-scoped User ID) but this means I keep managing the FB ids on our db, is this a good approach? or should I move on to manage the app scope ids? how can I get them for my V1.0 apps before this transition takes place? can I migrate my data in db (when having FB global ids only)? or do I must have a user access token in order to get this info?
Thanks!
Ilana

Updating Woocommerce Orders Programmatically

I have an eCommerce site running Woocommerce on top of Wordpress, and the company running it has changed there shipping system to an external company who stores the products in their warehouse and ships the products when they are bought.
In terms of automation, downloading information on new orders and sending it to the shipping company is fine, but when they respond to me with an XML of the orders sent and the associated tracking numbers, I need to be able to have a system that automatically updates the orders (including sending out the emails necessary). However, the only way I currently know how to do that is to update the MySQL database. But with that method, the automated email system is overridden and ignored.
Does anyone know how I can update orders statues and other information programmatically, which would allow Woocommerce's internal functions to be executed in the same way as manually logging into the admin side and updating the order?
Found a solution to this yet?
The code below works to mark an order as complete, but does not execute other actions as you describe in the admin
// create a new checkout instance and order id
$checkout = new WC_Checkout();
$this_order_id = $checkout->create_order();
$order = new WC_Order($this_order_id);
$order->update_status('completed');

How to integrate with mysql in google checkout?

I am working on Google checkout to sell my product online. i want order information to be stored in mysql database on my server only after payment verification of customer.when customer click on order now button on Google checkout synchronously that order complete information to be stored in database also. i m in fix to solve this but not getting any way of out..
Please note that the order is not complete when the customer clicks the Buy Now button. The order is complete after the customer finishes the order on Google Checkout's "Place Order" page and Google verifies and charges the credit card.
To get order processing details use the Google Checkout Notification API:
http://code.google.com/apis/checkout/developer/Google_Checkout_XML_API_Notification_API.html
You'll get callbacks at various order processing stages which will allow you to update your database and inventory accordingly.