• Prem Patel 8
  • NEWBIE
  • 10 Points
  • Member since 2023

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 0
    Replies
Hello Everyone,

I'm currently in the process of integrating Salesforce with Microsoft Azure Open AI and I've run into an authentication issue when attempting to send a POST request to the Azure Open AI service. I've configured the REST API call with the Azure Open AI Endpoint, Subscription ID and API key for authentication. Keeping in mind, I've already have an Azure Open AI Account/ Subscription and I have obtained the API Key and Endpoint from the Azure Open AI. However, I'm consistently encountering the following error:

" System.HttpResponse[Status=Unauthorized, StatusCode=401] & { "statusCode": 401, "message": "Unauthorized. Access token is missing, invalid, audience is incorrect (https://cognitiveservices.azure.com), or have expired." }"

For reference, here are the details of how I've configured the authentication:

Azure Open AI Endpoint: My endpoint is in the following format: "https://{your-resource-name}.openai.azure.com/openai/deployments/{deployment-id}/chat/completions?api-version={api-version}"

: In my code, I've set it as follows:
request.setEndpoint(' https://{your-resource-name}.openai.azure.com/openai/deployments/{deployment-id}/chat/completions?api-version={api-version}');

2. Azure Open AI API Key: I've included the API Key in the request header like this: request.setHeader('Authorization', 'Bearer ' + apikey);

3. Content-Type: I've also set the Content-Type in the request header: request.setHeader('Content-Type', 'application/json');

Here is the overall snippet of the code if that helps:
public static string AI(String check){
Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint(' https://{your-resource-name}.openai.azure.com/openai/deployments/{deployment-id}/chat/completions?api-version={api-version} ');
request.setMethod('POST');
request.setHeader('Content-Type', 'application/json');
request.setHeader('Authorization', 'Bearer ' + apikey);
String requestBody = '{"model":"gpt-4","messages":[{"role":"user","content":"' + check +'"}], "max_tokens":8000}'
request.setTimeout(120000);
request.setBody(requestBody);
HttpResponse response = http.send(request);
System.debug(response.getBody());
return response.getBody();
}


: I would greatly appreciate any insights or guidance on how to resolve this authentication issue and establish a successful connection between Salesforce and Microsoft Azure Open AI.
Hi All,

I have currently created and activated an Entitlement Process as well as created an Entitlement named "Gold Support" related to an account named "ABC Corp". I have also created many other accounts associated with an Entiement named "Gold Support". 

My Question is how can I automate the Enitlement name field during a case creation using Flow Automation?

Keep In mind I'm trying to add a specific Account Entitlement to a case that is specific to that Account. An example is I created an Entitlement "Gold Support" on "ABC Corp", when I create a new case it should automatically add the Gold Support Entitlement for Account "ABC Corp" to the case of the "ABC Corp". 

That same process should be other Accounts associated with their own Entitlements to their respective cases. I don't want an Gold Support Entitlement of Account "ABC Corp" added to a different Account case such as "Grand Hotel Inc". I want the respective acccount entitlements to be added to their own respective cases using Flow Automation.

I currently created a flow automation but the entitlement is overlapping with other Account cases as well. Can you give me a step by step process how i can achieve this in Flow Automation. 
Hi All, 

I created an Entitlement Process with the Basic Configuration for a Case and the Case exits the process when the Case Status != New. I have also created an Milestone and attached to the entitlement process where the time trigger is 480 minutes = 8 hours and keeping in mind I've attached the business hours is 8 hours (Mon-Fri).

My Question, what is the proper way of creating a Milestone action if the Milestone Time trigger is 480 min and I'm trying to create an Email Alert that triggers when it hits 24 hours?

I'm trying to create an Action where the Email Alert should be recieved when it hits 24 hours exact after a new case is created. For example If someone created a case on Aug 1st 3:00pm , the person should get an email alert on Aug 2nd 3:00pm, but the business hours is (Mon-Fri) 9-5pm and Milestone Time Trigger is set to 480 min (8 hours).

Will I need to create a Violation Action within the Milestone and have the criteria 960 min after the milestone time has ended (480min) and attach an Email Alert ?


 
Hello Everyone,

I'm currently in the process of integrating Salesforce with Microsoft Azure Open AI and I've run into an authentication issue when attempting to send a POST request to the Azure Open AI service. I've configured the REST API call with the Azure Open AI Endpoint, Subscription ID and API key for authentication. Keeping in mind, I've already have an Azure Open AI Account/ Subscription and I have obtained the API Key and Endpoint from the Azure Open AI. However, I'm consistently encountering the following error:

" System.HttpResponse[Status=Unauthorized, StatusCode=401] & { "statusCode": 401, "message": "Unauthorized. Access token is missing, invalid, audience is incorrect (https://cognitiveservices.azure.com), or have expired." }"

For reference, here are the details of how I've configured the authentication:

Azure Open AI Endpoint: My endpoint is in the following format: "https://{your-resource-name}.openai.azure.com/openai/deployments/{deployment-id}/chat/completions?api-version={api-version}"

: In my code, I've set it as follows:
request.setEndpoint(' https://{your-resource-name}.openai.azure.com/openai/deployments/{deployment-id}/chat/completions?api-version={api-version}');

2. Azure Open AI API Key: I've included the API Key in the request header like this: request.setHeader('Authorization', 'Bearer ' + apikey);

3. Content-Type: I've also set the Content-Type in the request header: request.setHeader('Content-Type', 'application/json');

Here is the overall snippet of the code if that helps:
public static string AI(String check){
Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint(' https://{your-resource-name}.openai.azure.com/openai/deployments/{deployment-id}/chat/completions?api-version={api-version} ');
request.setMethod('POST');
request.setHeader('Content-Type', 'application/json');
request.setHeader('Authorization', 'Bearer ' + apikey);
String requestBody = '{"model":"gpt-4","messages":[{"role":"user","content":"' + check +'"}], "max_tokens":8000}'
request.setTimeout(120000);
request.setBody(requestBody);
HttpResponse response = http.send(request);
System.debug(response.getBody());
return response.getBody();
}


: I would greatly appreciate any insights or guidance on how to resolve this authentication issue and establish a successful connection between Salesforce and Microsoft Azure Open AI.