The CreatorCon Call for Content is officially open! Get started here.

How can we connect to salesforce via REST API without losing connection?

Javier Marquina
Kilo Explorer

We are trying to do an update on Salesforce through REST API + Business Rule, so we have created a REST message (Salesforce REST), with a HTTP Method (Default GET).
If we manually force getOauthToken (click on the link that says "get Oauth token"), and we execute the business rule (which has a part of Javascript code we've developed), it works perfectly. The problem lies on the following attempts to connect again after some minutes, that throws the error attached to this case.
We would like to connect instantly through Javascript so this business rule can be executed everytime we close a ServiceNow ticket.

7 REPLIES 7

to be honest without having access to required system its hard to know exactly whats failing , am assuming you are not using exactly this script and this is a sample of what the actual one is with proper variables already substituted , right ? if that's the case seems like SF is saying you are missing some crucial headers ! in that case you will have to refer SF api docs and if you have any contacts of the team

leoferrero
Tera Contributor

Hi Javier did you find the solution?

Mathieu Lepoutr
Mega Guru

Hi Javier

 

Please share the logs so I can dig deeper in this use-case.

For now for this use-case of establishing an instant connection and ensure a smooth execution of the business rule every time a ServiceNow ticket is closed, I would consider an integration tool like Exalate. It is fully decentralized, I have been using it for quite a long time and it works amazingly fast for these type of things.