All Questions
Tagged with namedcredentials rest-api
28 questions
0
votes
0
answers
149
views
Google Cloud Connection Works with Apex Auth Class but not with Named Credentials
I have hosted an API on google cloud run and the downloaded the service account credentials in below format.
{
"type": "service_account",
"project_id": "...
1
vote
1
answer
437
views
Access Named Credentials with Guest User
I have created a Rest Service which accepts incoming Webhooks from Concur to notify Salesforce an Expense Report is ready. I am then using a Callout Class to fetch the Expense Report details from ...
1
vote
1
answer
157
views
http call out to an external REST webservice
Simple use case -
make a http call out to an external REST webservice. Parse the JSON response.
I know I could do this using Flow, but due to the business requirement have opted for Apex Class.
Can ...
1
vote
1
answer
314
views
External named Credential is not able to fetch in Apex code for Winter 24 Pre
Created the External Named credential with name Samsung Test
Added the Principal
Added the permission set
However I am not able to fetch this named credential in Apex code.
HttpRequest req = new ...
1
vote
0
answers
384
views
Rotating External Credential Principal
I am looking to call an external API from Salesforce using AWS Signature v4. The external API is using AWS API Gateway with IAM authorization enabled. I have created an access key for an IAM user and ...
0
votes
1
answer
136
views
Reply to Trustpilot Review Service Reviews API returning 400 Bad Request
This is my code in Salesforce
HttpRequest req = new HttpRequest();
req.setEndpoint('callout:TrustPilot/private/reviews/'+reviewId+'/reply?token='+token);
req....
0
votes
1
answer
2k
views
Using named credentials with a custom external API
I am trying to implement named credentials to make callouts from Salesforce to a custom built external API. The external API has a login endpoint that returns a token, and then there are other ...
2
votes
1
answer
804
views
OAuth2 bearer token is not being saved in Named Credential and cannot use {!$Credential.OAuthToken}
I am trying to create an LWC that takes in 2 addresses from the UI and uses Fedex's Rates API to get the estimated cost.
I have the "Token Endpoint URL" but the API docs but it does not ...
1
vote
1
answer
3k
views
Problem setting up Named Credential for REST callouts
I want to do Apex REST callouts to a JSON web service. I've got a "Client-Id" and "Client-Secret", and they need to be sent in the HTTP header for authentication throughout, along ...
0
votes
0
answers
2k
views
How to use Named Credentials in a Basic Auth callout with API key?
This initial code works perfectly to do a Callout with UN, PW and API key in Custom Settings.
But this is less secure and so I want to move teh UN & PW to Named Credentials.
but it fails.
This ...
-1
votes
1
answer
1k
views
Move files from one folder to another using Google Drive API and Apex [closed]
I’m making a callout using named credentials and trying to update the parent Id of the G-Drive file. While doing the callout, getting the below error.
"error": { "errors": [ {...
0
votes
0
answers
583
views
Named Credentials with Authorization Protocol OAuth 2.0 vs authorization and authentication handled using apex
Could anyone please clarify my doubts. If I use Authentication Protocol as Oauth 2.0 and provide an Authentication Provider for the same with required settings and call a rest end point of different ...
4
votes
1
answer
8k
views
Should Named Credentials be used to store an API Callout Bearer Token?
Problem
I have a straightforward REST API callout in apex.
request.setEndpoint('https://api.websitename.com');
request.setMethod('GET');
request.setHeader('Authorization','Bearer ...
1
vote
0
answers
196
views
Setting up Auth Provider with SSO
I am calling a REST API using Auth provider and Named credential, but the client wants to use their IDP SSO instead of using API credentials. Is there a way we can configure an SSO with Auth Provider ...
3
votes
1
answer
383
views
How to use Named credentials with a 2 step password and access token authentication system?
The third party system that I am trying to connect to has following authentication mechanism:
Step 1: We have been provided with a X-Api-User and X-Api-Secret to be included in header.
Other header ...
5
votes
0
answers
677
views
JWT Token Exchange setup in Named Credentials for outbound callout
Trying to integrate with okta api from Salesforce that supports JWT Token exchange. I was able to successfully get the access token with the below code but I am blocked on how to use named credentials ...
1
vote
1
answer
3k
views
Callout to other Salesforce org using Named Credential - which Authentication option should I use?
I have 2 Salesforce orgs (with identical code) - a hub and a client. I need to pass data from the hub to the client. Using S2S is fine for normal data, but when it comes to files (eg pdf) we can't use ...
2
votes
1
answer
169
views
Calling REST APIs from Lightning
We are currently working on an app where we are calling the Tooling API from our Lightning component
Since UserInfo.getSessionId() is not valid in Lightning context, to make the call we are using VF ...
0
votes
1
answer
3k
views
Using {!$Credential.OAuthToken} in an apex Class
I wrote the code below.
HttpRequest req = new HttpRequest();
req.setMethod('GET');
req.setEndpoint('callout:namedCredential/services/apexrest/customRestAPIGetAccount`);
req.setHeader('Authorization',...
0
votes
1
answer
2k
views
Unauthorized Access using Named Credentials [duplicate]
I am using Named Credentials oAuth2.0 protocol to connect with Xero. I have setup Auth. Provider and Named Credential. Named Credential is also authenticated.
I have followed the steps mentioned here ...
0
votes
0
answers
1k
views
AWS Signature Version 4 Named Credential doesn't seems like working
I have requirement to fetch a file from s3 server to Salesforce. As a part of Summer'19 release, Salesforce has provided AWS Signature Version 4 protocol in Named credential.From below link I see that ...
2
votes
1
answer
4k
views
Apex call-out 404 not found error on Developer console while it works perfectly when the request is sent through postman
This is the request, I've added the URL to named credentials. What am I doing wrong!!
Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint('Callout:AppointmentTest/...
6
votes
1
answer
5k
views
Connect to Salesforce production REST API from Sandbox using Named Credentials
Background
I would like to connect to the REST API of a production org, from a sandbox org.
Configuration so far:
Production Org has a Connected App
Sandbox Org has a Auth. Provider
Sandbox Org has ...
0
votes
1
answer
2k
views
Named credential for gotoWebinar app (oauth v2.0)
Is it possible?
My steps:
Create the app in the Developer Center. On the Application URL I left the suggestion https://api.getgo.com (I guess this could be an issue, do I have to fill this with a ...
1
vote
1
answer
2k
views
With Named Credentials, why should you ever use remote sites?
With Named Credentials, do I in fact have the ability to make callouts to external systems which do not require autentication? If that is the case, why should I ever use remote sites?
1
vote
3
answers
15k
views
UserName and Password in Request body of apex callout using Named Credentials
I am able to make an apex callout by passing the username and password in the request body.
String endpoint='https://xyz...com/';
String userID='xyz';
String password='pass';
String jsonBody ='userID=...
2
votes
1
answer
9k
views
Using Named Credentials with OAuth 2.0 username & Password Authentication
I created a new connected apps and obtained the Client secret and Id. I am trying to make a login call to another Salesforce org to obtain the access token. Below approach was successful:
String ...
9
votes
3
answers
2k
views
Session expired or invalid
I am trying to build Salesforce to Salesforce integration using Named Credentials.
Followed steps from below blog.
http://www.jitendrazaa.com/blog/salesforce/salesforce-to-salesforce-integration-...