chatwoot/app/javascript/dashboard/api/agentBots.js
Sojan Jose 873cfa08d8
feat: Ability to reset api_access_token (#11565)
Co-authored-by: Muhsin Keloth <[email protected]>
Co-authored-by: Sivin Varghese <[email protected]>
Co-authored-by: iamsivin <[email protected]>
Co-authored-by: Shivam Mishra <[email protected]>
2025-05-29 14:42:13 +05:30

31 lines
670 B
JavaScript

/* global axios */
import ApiClient from './ApiClient';
class AgentBotsAPI extends ApiClient {
constructor() {
super('agent_bots', { accountScoped: true });
}
create(data) {
return axios.post(this.url, data, {
headers: { 'Content-Type': 'multipart/form-data' },
});
}
update(id, data) {
return axios.patch(`${this.url}/${id}`, data, {
headers: { 'Content-Type': 'multipart/form-data' },
});
}
deleteAgentBotAvatar(botId) {
return axios.delete(`${this.url}/${botId}/avatar`);
}
resetAccessToken(botId) {
return axios.post(`${this.url}/${botId}/reset_access_token`);
}
}
export default new AgentBotsAPI();