Hot to create new channel in Teams that is not hidden, using GraphAPI - azure-ad-graph-api

I have an app that uses microsoft's graphAPI to create channels in my organizations Team dynamically. All is well and I can create the channels, except the channels I'm creating are marked as hidden - users need to manually "show" the channel before reading messages or even get notifications.
Is there any way to bypass this "hidden" thing? Can i force the created channels to be visible for every user in the team, without the approving them first.

In theory, this function is controlled by isFavoriteByDefault, and when setting it to true, the channel should automatically be marked 'favorite' for all members of the team.
Unfortunately, after doing some research and test, I find that this property can't be changed through Graph API. So currently we can't bypass the "hidden" thing.
A similar post: Microsoft graph BETA add Microsoft Teams channel with isfavoritebydefault. The Microsoft engineer mentioned that could be they didn't fix the path POST /teams/id/channels.

I was able to add this but I see some inconsistency in the responses. For example if i run a flow that does the graph api process to create a channel within a team it only sets the show under channels for my account not the rest of the users associated with it. I don't know if anyone else has experienced this or has a fix.
Here is my sample:
{
"requests": [
{
"url": "/teams/{varTeamID}/channels",
"method": "POST",
"id": 1,
"headers": {
"Content-Type": "application/json"
},
"body": {
"displayName": "{varChannelName}",
"description": "This channel is in existence for",
"isFavoriteByDefault": true
}
}
]
}

Related

Is it possible to set out user status message in teams through graph API?

I want to set user status message in teams using graph api and I saw this code but it's not working for me is there any solution that could help??
"#odata. context":"https://graph.mic.."
"id": "f599db41-7474-416a-acb1-88f9e
"availability": "Available"
"activity" :"Available"
"outofOfficeSettings": {"message": "oof mes"
"is0utofoffice":true }
Note: the availability & activity is working and has been updating in teams but the part below is not working for me""
or is there any way using graph api that I could set teams status message from bambooHR direct to teams?
You cannot set out of office user presence through graph API. As of now, only the parameters mentioned below are supported in the body of setPresence call
POST https://graph.microsoft.com/beta/users/object_id_of_user/presence/setPresence
Also, this call is supported under Application context only and not under user context.
sessionId
availability
activity
expirationDuration
However, you can view the out of office user presence via graph API by using below call:
GET https://graph.microsoft.com/beta/me/presence
or
GET https://graph.microsoft.com/beta/users/object_id_of_user/presence
{
"id": "fa8bf3dc-eca7-46b7-bad1-db199b62afc3",
"availability": "Available",
"activity": "Available",
"outOfOfficeSettings": {
"message": null,
"isOutOfOffice": false
}
}
Ref Doc:
https://learn.microsoft.com/en-us/graph/api/presence-get?view=graph-rest-beta&tabs=http
https://learn.microsoft.com/en-us/graph/api/presence-setpresence?view=graph-rest-beta&tabs=http
If you wish you may vote for this feature on Microsoft Teams · Community

Get GitHub security alerts through notification API

I want to get GitHub notifications about a given repo’s Security alerts through the notification API, and I would like to know the JSON returned by this API.
Let say for a given repo I subscribed to the Release and Security alerts in GitHub UI:
When I publish a “Security advisory” on a given repo, I don’t receive any notification with the others account subscribed to this repo. I think this is because GitHub needs to validate this security advisory before it sends the notifications events.
So can someone please give me an example of JSON returned by the notification API for a Security event ?
Here is an example of JSON returned by the notification API for the Release events (as I can generate some by myself):
curl -su <me>:<token> https://api.github.com/notifications
[
{
"id": "3267365319",
"unread": false,
"reason": "subscribed",
"updated_at": "2022-03-14T16:07:41Z",
"last_read_at": null,
"subject": {
"title": "0.5.0",
"url": "https://api.github.com/repos/pfrayer/release-tester/releases/61780007",
"latest_comment_url": "https://api.github.com/repos/pfrayer/release-tester/releases/61780007",
"type": "Release"
},
"repository": {
...
I’m looking for the same kind of JSON, but for the Security events.

How to set the tracking_specs when creating Facebook ads?

I am trying to create an ad using the Facebook Marketing API. In order to create an ad inside a conversion based campaign, I am required to set proper tracking_specs values.
Querying existing ads (on other similar campaigns) I see the tracking spec is generally defined as follows:
"tracking_specs": [
{
"action.type": ["offsite_conversion"],
"fb_pixel": [<pixel ID>]
},
{
"action.type": ["post_engagement"],
"page": [<page ID>],
"post": [<post ID>]
},
{
"action.type": ["link_click"],
"post": [<post ID>],
"post.wall": [<post.wall ID>]
}
]
How do I find the required tracking_specs values? More specifically, how do I find the post ID and the post.wall ID accordingly for post_engagement and link_click action types?
I managed to figure it out on my own. When creating a new ad, in a conversion typed campaign, an ad data object that includes tracking specs should be provided. These tracking specs should include some reference to a Facebook pixel.
"tracking_specs": [
{
"action.type": ["offsite_conversion"],
"fb_pixel": [<pixel ID>]
},
]
The pixels data can be obtained manually via the Facebook Business Manager or via the Facebook Marketing APIs:
GET /v2.10/{ad-account-id}/adspixels HTTP/1.1
Host: graph.facebook.com
Read more in https://developers.facebook.com/docs/marketing-api/reference/ad-account/adspixels/
Regarding the post and post.wall IDs - these are automatically added by Facebook when the ad is created. So there is no need to include theses when creating the ad.
For anyone searching for an answer in 2023. asaf's answer is totally correct BUT you also need to wait until Meta Business Manager processes your campaign in order to see tracking_specs into the API and in the Business Manager itself.

Auto create google groups from sheets

Searched the net, youtube, and google forums/documentation but can't seem to find this one even if it is possible.
I'm using a google form as a starting point for a workflow that then gets turned into a google group. Is there any scripts that can auto create a google group from the google forms output in sheets once form is submitted?
Thanks in advance.
I haven't tested this yet, so just give it a try. This is what I've found. Directory API let's you create a group by making a POST URI request:
https://www.googleapis.com/admin/directory/v1/groups
with request body:
{
"email": "sales_group#example.com",
"name": "Sales Group",
"description": "This is the Sales group."
}
Since you are using Google Forms, the option would be to use AppScript to perform the XHR request.
Try to make use of Class UrlFetchApp in Appscript.
var options =
{
"method" : "post",
"payload" : payload
};
UrlFetchApp.fetch("http://example.com/upload_form.cgi", options);

Posts from Instagram not showing up on Facebook Open Graph API

I have an issue with Facebook OpenGraph API. Whenever I request data using either '/home' or '/feed', none of the posts from Instagram showed up.
I've been googling around and apparently some people raised the same issue with no solution yet. And I read some that the issue not only affecting posts from Instagram, but also other third-party app/device/platform.
Even the ticket posted on Facebook's dev page seems somewhat dead (no continuation). Link: https://developers.facebook.com/bugs/110563582419837/
If any of you guys also stumbled on this issue and has some ideas/pointers/links, please do share and let's discuss it.
Much appreciated. Cheers!
There are two bug reports in Facebook's bug tracker about this:
https://developers.facebook.com/bugs/110563582419837 and https://developers.facebook.com/bugs/202119973248747
The core reason is that the photos are attached to Open Graph actions as User Generated Photos and not via the regular Photo upload API.
As such, the regular photos permissions don't grant access to them and you need the user to specifically allow you the access their Open Graph activity for the app that posted the actions. The bug reports above are accepted on the basis that this appears to be an oversight in the case of actions with user generated photos, but it could also be by design in which case what i've outlined below as a workaround would be the only supported way to do this:
If you specifically need to request Instagram (or another Open Graph photos app) photos for a user, you can ask for Permission to access the actions posted by that app.
For Instagram photos you can do this by requesting the user_actions:instapp permission and once you've done that the Instagram Photos album will no longer appear to be empty, and the Instagram activity will appear in the feed connection.
To find out the namespace for an arbitrary app, access https://graph.facebook.com/<APP ID> and look for the namespace field,
e.g. for instagram, a call to https://graph.facebook.com/124024574287414/?fields=id,namespace returns:
{
"id": "124024574287414",
"namespace": "instapp"
}
A sample photo from my own /feed connection, retrieved with the read_stream, user_photos, user_actions:instapp permissions, is:
{
"data": [
{
"id": "[SNIPPED]",
"from": {
"name": "[SNIPPED]",
"id": "[SNIPPED]"
},
"picture": "[SNIPPED]",
"link": "https://www.facebook.com/photo.php?fbid=[SNIPPED]",
"icon": "https://fbstatic-a.akamaihd.net/rsrc.php/v2/yb/x/StEh3RhPvjk.gif",
"privacy": {
"value": ""
},
"type": "photo",
"object_id": "[SNIPPED]",
"application": {
"name": "Instagram",
"namespace": "instapp",
"id": "124024574287414"
},
"created_time": "2013-01-07T17:33:04+0000",
"updated_time": "2013-01-07T17:33:04+0000",
"comments": {
"count": 0
}
},
I can also access the /photos connection of my 'Instagram Photos' album with the same permissions, and can access all Instagram 'take' actions (i.e the photos) at /me/instapp:take
Facebook employee here. Looking at the internal task that is tracking this issue, all I can say at this time is that this is an issue that we are currently aware and investigating into. If you would like to be notified of any updates, be sure to click "subscribe" on the bug report.
For the time being, I recommend finding the album ID of the user named "Instagram Photos", then calling a GET request to /INSTAGRAM_ALBUM_ID/photos to get their Instagram photos. On the Graph API Explorer tool, I confirm that I am able to fetch all of my instagram pictures. Since my album is public, you should be able to view them as well.