function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Saon Das 6Saon Das 6 

Inbound Rest API Authentication

I am using inbound rest api call to Salesforce from external system. External system does not want to hit token service everytime and then salesforce api. I tried to use connected app where in policy I configured  refresh token for certain period of time(years) but it is also getting changed. Is there any way I can achieve this.
Best Answer chosen by Saon Das 6
VinayVinay (Salesforce Developers) 
Hi Saon,

I don't think you can authenticate and execute in single api call.

However you can take a look at 'Composite' which executes a series of REST API requests in a single call. You can use the output of one request as the input to a subsequent request.

Below are few examples and usage details.

https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_composite_record_manipulation.htm
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/calls.htm
https://rajvakati.com/2018/03/08/salesforce-rest-api-composite-resources/

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,
Vinay Kumar

All Answers

VinayVinay (Salesforce Developers) 
Hi Saon,

No. Access tokens/session IDs are time limited, and you have to authenticate to get one. There is no static token with Salesforce.

Please review below links and gives you more information.

https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/quickstart_oauth.htm
https://chicagocloudgroup.com/salesforce-rest-api-connected-apps-apex-rest-methods/

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,
Vinay Kumar
Saon Das 6Saon Das 6
Hey Vinay,

Thanks for your reply. I too thought so. Is there any way that in single call to salesforce API it can be authenticated.

Thanks,
Saon
VinayVinay (Salesforce Developers) 
Hi Saon,

I don't think you can authenticate and execute in single api call.

However you can take a look at 'Composite' which executes a series of REST API requests in a single call. You can use the output of one request as the input to a subsequent request.

Below are few examples and usage details.

https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_composite_record_manipulation.htm
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/calls.htm
https://rajvakati.com/2018/03/08/salesforce-rest-api-composite-resources/

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,
Vinay Kumar
This was selected as the best answer
Saon Das 6Saon Das 6
Hi Vinay,

Thanks for your input. I think it is not feasible what I was looking for. 

Cheers,
Saon