Here is the Google API Explorer for Google Drive / Files / List
https://developers.google.com/drive/api/v3/reference/files/list
I can access the account with a user account by logging in.
But I would like to access it as a service account to debug an issue with an API call there.
How will I access the API Explorer using a service account?
A service account is identified by an email address something like [email protected].
I believe you want to achieve above. For this, how about the following answer?
Unfortunately, "Try this API" can be used for the login account. So in this case, the service account cannot be used for "Try this API".
So as a workaround, how about using the curl sample created by "Try this API"? The access token can be retrieved using the service account. When this access token is used for the curl sample created by "Try this API", you can test the API using the service account.
Please access to https://developers.google.com/drive/api/v3/reference/files/list. And please click a square button. You can see it at the following image.
By this, you can see the opened window as shown in the following image.
When you change the parameters for the API, the curl sample is also changed. Here, please copy the curl sample like below.
curl \
'https://www.googleapis.com/drive/v3/files?key=[YOUR_API_KEY]' \
--header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
--header 'Accept: application/json' \
--compressed
The sample scripts for retrieving the access token from the service account are as follows.
The expiration time of access token is 1 hour. Please be careful this.
Using the retrieved access token, you can test "Try this API" with the curl sample as follows.
curl \
'https://www.googleapis.com/drive/v3/files' \
--header 'Authorization: Bearer ###' \
--header 'Accept: application/json' \
--compressed
?key=[YOUR_API_KEY]
. Because the API key is not used for this.