question

AndrewKennard-1022 avatar image
0 Votes"
AndrewKennard-1022 asked WendyLi-MSFT commented

How to cope with DriveItem/Activity/ListItem

I'm not writing code in VB or C# but if I were how do people 'cope' with the DriveItem resource ?

It contains ListItem and Activity which also contains DriveItem and ListItem contains Activity too

So do people just recursively traverse through the JSON looking for what they need as opposed to moving things into a struct which makes addressing things much easier later but you can't have recursive structs unless it is an array of itself which doesn't help here I don't think

It all just feels a bit Penrose Stairs

microsoft-graph-files
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MichaelHan-MSFT avatar image
0 Votes"
MichaelHan-MSFT answered WendyLi-MSFT commented

Hi @AndrewKennard-1022,

According to the documentation: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/activities_list?view=odsp-graph-online

The response for the item activities is a json object, and the value is array of ItemActivity resource type


If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.






· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for the reply

I'm looking at this https://docs.microsoft.com/en-us/graph/api/resources/itemactivity?view=graph-rest-1.0

Which has driveItem as a child element and driveItem contains an array of ItemActivity

So if I define my ItemActivity before driveItem then driveItem can have an array of ItemActivity

But I can't do that because ItemActivity contains driveItem and listItem for that matter

0 Votes 0 ·

I did a test to get the driveitem activities. In the response, i didnot see the driveItem property in the response, So you could just ignore it for ItemActivity.


0 Votes 0 ·

The driveitem is just a propery in the itemActivity resource.

And as far as I know, there is no such DriveItem/Activity/ListItem in the graph api endpoint.

0 Votes 0 ·

@AndrewKennard-1022 Do you have any further questions about this thread? If you have any concerns, please feel free to reply.


If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

0 Votes 0 ·