Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
637 views
in Technique[技术] by (71.8m points)

office365 - Shared Calendar is not showing up in azure get calendar connector for Office 365

I have a shared calendar in Office 365 with read and write permissions and I am trying to get it using Get calendar (V2) connector but it is only getting my own calendar. Is there a way to get shared calendars for Office 365 in Azure logic apps?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

For this problem I did some test and it seems the "Get calendar (V2)" action in logic app can't get the calendars which others shared to you. But I provide another solution(use graph api) below for your reference:

1. You need to ask others to share a calendar to you on office 365 web page but not in outlook app. enter image description here enter image description here

2. Then you need to create an application in your azure AD, please refer to this tutorial.

In the application you created in azure ad above, please do the steps below: enter image description here enter image description here

After that, please do not forget click the "Grant admin consent for xxx" button(Maybe you need to wait a few minutes until this button become clickable). enter image description here

Then click "Certificates & secrets" in your application in azure ad and new a client secret.(copy this client secret to your note book) enter image description here

3. Then create a "HTTP" action in your logic app and refer to the screenshot below to request for the access token.

enter image description here

The "client_id" is your appliction id in azure ad, "username" and "password" is your azure user name and password, the "client_secret" is what you got above. This "HTTP" action will help us to get the access token. The response should be like below: enter image description here

Then we need to parse the response data in json type, you can use "Parse JSON" action. enter image description here

Use the "Body" from the "HTTP" action and fill in the "Schema" box with the code below:

{
    "properties": {
        "access_token": {
            "type": "string"
        },
        "expires_in": {
            "type": "integer"
        },
        "ext_expires_in": {
            "type": "integer"
        },
        "scope": {
            "type": "string"
        },
        "token_type": {
            "type": "string"
        }
    },
    "type": "object"
}

4. After that, we can create another "HTTP" action in logic app and request the graph api for all of the calendars which you can see (please note there is a space between the "Bearer" and the "access_token"). enter image description here

5. At last, we can get all of the calendars in the second "HTTP" action's "OUTPUTS" box. enter image description here

Hope it helps~


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...