My Einstein Bot is asking for some parameters and should call an Apex Class with those parameters. There is one Class kinda like a Controller which is called by the Einstein Bot itself, which calls anothers Class with all the technical stuff and REST Callout. But all the time I reach the Apex Call situtation within the chatbot, an error occurs:
Insufficient access exception when invoking /support/conversations/.../invocations/...: [{"message":"You don't have access to the Apex class: Chatbot_Controller","errorCode":"INSUFFICIENT_ACCESS"}].
Looks like a permission Problem, do you know how to fix that?
I'll paste the Chatbot_Controller Class aswell:
public with sharing class Chatbot_controller {
public class InformationOutput {
@InvocableVariable(required=true)
public String price;
}
public class InformationInput {
@InvocableVariable(required=true)
public String zipcode;
@InvocableVariable(required=true)
public String city;
@InvocableVariable(required=true)
public String amount;
@InvocableVariable(required=true)
public String product;
public String getCity(){return city;}
public String getZipcode(){return zipcode;}
public String getamount(){return amount;}
public String getProduct(){return product;}
}
@InvocableMethod(label='xxx')
public static List<InformationOutput> getPrice(List<InformationInput> chatbotInput){
InformationInput inp = new InformationInput();
inp = chatbotInput.get(0);
String zipcode = inp.getZipcode();
String amount = inp.getamount();
String city = inp.getCity();
String product = inp.getProduct();
RestClass com = new RestClass();
String cost = com.callout(zipcode, amount, city, product);
List<InformationOutput> resp = new List<InformationOutput>();
InformationOutput re = new InformationOutput();
re.price = cost;
resp.add(re);
return resp;
}
}