So I am working on this project where I am using a reactjs panel to create categories. Now I am trying to make the bot use this categories as an entity, I have a nodejs server that the bot uses for webhook calls, now I have 2 options to add the category as an entity. I can use the restAPI for dialogflow batchUpdate entity, but this requires authentication, I was only able to get it to work with a bearer token but those needs to be regenerated every hour (max is 12 hours) which is not possible for deployment. I also tried to send a call to my nodejs server where I tried using the actions-on-google library but again I am using the old dialogflow-fullfilment library to handle all my replies and stuff and the 2 libraries conflict. so what are my options here? is it possible to use dialogflow-fullfilment library top update entities ? or is there a way to either have a lifetime bearer token or any other auth method that google api's accept that I can use?
here is the api I used
https://dialogflow.googleapis.com/v2/projects/<project-id>/agent/entityTypes/<entity-id>/entities:batchUpdate
here is the body I send
{
"name": "projects/\<project-id\>/agent/entityTypes/\<entity-id\>",
"displayName": "cityPanel",
"kind": "KIND_MAP",
"entities": \[
{
"value": "Cairo",
"synonyms": [
"Cairo"
]
}
]
}
this is working fine but i need to generate a new bearer token every hour which is not possible for me.