0

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;
  }  
}

1 Answer 1

1

Okay actually I found the error by myself :D Had to go to SetUp ==> Permission Sets ==> sfdc.chatbot... ==> Apex Classes ==> add the Function you want to call

1
  • I think you meant to say, you enabled Apex Class access to the sfdc.chatbot Permission Set, right? Not the function you want to call. Commented Nov 17, 2021 at 10:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .