I'm developing a chatbot using Dialogflow and I need to get full conversation log from it.
I checked this page and I guessed it is able to achieve it by using Stackdriver Logging api.
I referred below page and I tried, however using this api, it occurs 403 error. https://cloud.google.com/logging/docs/reference/v2/rest/v2/logs/list
Did I use this in a wrong way?
How can I resolve this problem?
This is the error message.
{
"error": {
"code": 403,
"message": "The request is missing a valid API key.",
"status": "PERMISSION_DENIED"
}
}
This is my code where calling the api. I used Google Apps Script.
function getLogs() {
//XXXXXXXX is my project_id
var output = UrlFetchApp.fetch('https://logging.googleapis.com/v2/projects/XXXXXXXX/logs');
Logger.log(output)
}
Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.
. Is this result value what you want? Can I ask you about whether when you tested "Try this API" at the link you show, you could retrieve the result you want? – TanaikeHTTP/1.1 200 cache-control: private content-encoding: gzip content-length: 174 content-type: application/json; charset=UTF-8 date: Sat, 15 Feb 2020 06:15:20 GMT server: ESF vary: Origin, X-Origin, Referer { "logNames": [ "projects/XXXXX/logs/cloudaudit.googleapis.com%2Factivity", "projects/XXXXX/logs/cloudaudit.googleapis.com%2Fsystem_event", "projects/XXXXX/logs/cloudfunctions.googleapis.com%2Fcloud-functions", "projects/XXXXX/logs/dialogflow_agent", "projects/XXXXX/logs/script.googleapis.com%2Fconsole_logs" ] }
– SasuraiNoTsuba