Sharepoint Online(Using python office365 package) Listitem returning empty

62 Views Asked by At

I am having trouble retrieving results from SharePoint Online using Office365 and the RequestOptions package. Even though I can see data in the respective Listitems in SPO, I get an empty set as a result. If I use only till "lists", I am able to get the result in one big JSON string. Can someone help me resolve this issue?

import json
from office365.runtime.auth.user_credential import UserCredential
from office365.runtime.http.request_options import RequestOptions
from office365.sharepoint.client_context import ClientContext

site_url='https://xxxxxxxx.sharepoint.com/sites/xxxxxx'
ctx=ClientContext(site_url).with_client_credentials('#######', '######')
request = RequestOptions("{0}/_api/web/lists/GetByTitle('xxxxxx')".format(site_url))
response = ctx.pending_request().execute_request_direct(request)

I tried executing above code block. It returned as empty though in actual SPO site, I could able to see the Data.

0

There are 0 best solutions below