We are trying to configure Purview accounts using its REST APIs.
I have create a Purview account (purview-api-demo), and registered an Azure Blob Storage type source with it.
Following the REST APIs documentation here, I have created a service principal (purview-app-registration) and added its trust permissions as following:

Now, upon trying two different GET requests. One of them works, i.e. from tutorial in documentation. Here's the code for it:
def call_api(atlas_endpoint, access_token):
url = f"{atlas_endpoint}/api/atlas/v2/types/typedefs"
payload={}
headers = {
'Authorization': f'Bearer {access_token}'
}
response = request("GET", url, headers=headers, data=payload)
print(response.text)
atlas_endpoint="https://purview-api-demo.catalog.purview.azure.com"
call_api(atlas_endpoint=atlas_endpoint, access_token=output)
Although, when trying a similar GET requests, to list data sources, as documented here. It gives the following response:

Here's the code for the second GET request:
def list_data_sources(access_token, Endpoint, api_version="2018-12-01-preview"):
url = f"{Endpoint}/datasources?api-version={api_version}"
payload={}
headers = {
'Authorization': f'Bearer {access_token}'
}
response = request("GET", url, headers=headers, data=payload)
print(response.text)
scan_endpoint = "https://purview-api-demo.scan.purview.azure.com"
list_data_sources(access_token=output, Endpoint=scan_endpoint)
It would be great to have an explanation of why we are able to make one request successfully, while the other request to the same purview account returns unauthorized.
Thanks.

][2]