msgraph-sdk-python
msgraph-sdk-python copied to clipboard
How to use the SDK to write Graph calls that aren't provided by the SDK API
Ahoi,
first, thanks for the SDK. It makes life easier and helps me to stay in the python eco-system for such tasks.
Now, I'm not really understanding Graph or the SDK well enough to see how I could write my own queries.
For example, I'd like to call the reports/getTeamsTeamActivityDetail(period='D90')?$format=application/json endpoint. As I don't see it in SDK 1.0.0a12, I'd like to "manually" call it and process the results.
Is this even feasable? Please excuse me if this call actually is in the API and I just didn't see it - take it as an example.
Is calling arbitrary endpoints even supported? Did I miss this when reading in README / Samples?
@srmo
Hi there, thanks for trying out our SDK
Our SDK covers the entire surface area of the Graph v1.0 api so yes, the call is actually available using the SDK. The resultant call would be client.reports.get_teams_team_activity_detail_with_period('D90').get()
However to answer your question, yes we do support passing a url and getting back a response that is deserialized into the respective Graph model. We also support getting the native response, if you prefer to work with raw json.
I'll add these scenarios to the samples.
@samwelkanda : thanks for the hints! I'll try to get a better understanding of the API to be able to navigate it :)
@samwelkanda has the custom URL scenario been added to the samples?
Raw URL support is available in the SDK, we will look into updating the samples