2

As per my use case, I am downloading a reference attachment using below API endpoint

The attachment response JSON looks like:

Endpoint used:
https://graph.microsoft.com/beta/users/{self.account.get('id')}/events/{event_id}/attachments/{attachment_id}

{
    "id" : "AAMkADE3OWQ3OTFjLTU0OTgtNDRkNy04ZTI3LWQyNWNjYTY1ZWRmNABGAAAAAABllVu7mx4JR6WM4uKZvQNDBwCvejZTXM2tT4aB-oKU71SMAAAAQ5lgAACvejZTXM2tT4aB-oKU71SMAAAARKNMAAABEgAQAEBmtceBnMlHqdp1Vi_RAsI=",
    "lastModifiedDateTime" : "2019-11-04T05:53:26Z",
    "name" : "d.jpg",
    "contentType" : "image/jpeg",
    "size" : 424,
    "isInline" : true,
    "sourceUrl" : "https://xxxx.sharepoint.com/personal/xxxx_onmicrosoft_com/Documents/d.jpg",
    "providerType" : "oneDriveBusiness",
    "thumbnailUrl" : null,
    "previewUrl" : null,
    "permission" : "edit",
    "isFolder" : false,
    "@odata.type" : "#microsoft.graph.referenceAttachment"
}

After this step, I want to recreate an event on a newly created calendar. While doing so I am using below API endpoint to add the attachment to the new event.

Endpoint used:
https://graph.microsoft.com/beta/users/{self.account.get('id')}/events/{event_id}/attachments

Payload = 
{
  '@odata.type': '#microsoft.graph.referenceAttachment',
  'name': 'd.jpg',
  'contentType': 'image/jpeg',
  'sourceUrl': 'https://xxxx.sharepoint.com/personal/xxxx_onmicrosoft_com/Documents/d.jpg',
  'providerType': 'oneDriveBusiness',
  'permission': 'view',
  'isFolder': False
}

The attachment added successfully to the respective event. Now when I am trying to open the attachment on Microsoft calendar I am redirected to a "deeplink URL" on the browser and a continuous "loading" icon is appearing. The attachment is not opening. I am able to download the attachment intact.

My question is why it is not opening?

Note:

The event from where I downloaded the attachment, the attachment permission was set to "Recipient can view". The attachment I am trying is an Image

The attachment added should open on Microsoft Calendar.

Community
  • 1
  • 1

0 Answers0