Forum Discussion

lzapart's avatar
lzapart
New Contributor III
8 years ago

SalesForce - REST API with OAUTH2 Token Auto Refresh Issue

Hi,

Is anyone using REST Get snap with Salesforce instance using OAUTH2 account? I am having trouble with keeping my Account tokens up to date. I am able to connect and receive an Access Token and a Refresh Token on my account using the Account “Refresh” button. But SF does not provide me back a “Access token expiration” time. Apparently per SnapLogic support, I cannot enable “auto refresh token” on the account so the token can refresh without an expiration date on the token. I have to manually every hour open my account settings in Snaplogic account and hit “Refresh” to receive a new refresh and access tokens. If not, my snap step returns error “Session expired or invalid”,“errorCode”:“INVALID_SESSION_ID” in all of my pipelines. It’s very frustrating and redundant having to do this multiple times a day.

Is there a way to pass thru a expiration token time to the account? Or is there a way I can force a token refresh each time my pipeline runs without my input?

My use case is, SF snaps do not give us ability to access rich functionality such as getdeleted() or getupdated() on SF objects. These logs contain hard deleted items per object (when the object is replicated in SF) and we use these logs to keep the data in synch in our DB without having to re-download hundreds of millions of records per object every hour which is not possible. This log data is not accessible through SOQL as far as I can see and they are not in the recycle bin (hence hard deleted) so standard snaps don’t work for this.

Example of REST Get service url for hard deleted item logs:
https://instance#.salesforce.com/services/data/v39.0/sobjects/AccountTeamMember/deleted/?start=2017-09-13T00:00:00-00:00&end=2017-09-15T00:00:00-00:00

SF documentation: Developer SF REST API - GetDeleted()

Another way of getting these results from what I have read is to use REST API QueryAll() functionality in SF. But it uses same Account configuration.

Any help of feedback is much appreciated.

14 Replies

  • alex_panganiban's avatar
    alex_panganiban
    Contributor

    I tried playing with the “escape special characters” option, but it just dropped my special charcter data instead of leaving the escaped notations as they were.

    • mbowen's avatar
      mbowen
      Employee

      Hmmm… Frustrating indeed. Let me conduct an experiment too.

      • alex_panganiban's avatar
        alex_panganiban
        Contributor

        I’m wondering if there’s a way to make the XML Generator and the XML Formatter ignore escaped codes and leave them as they are instead of rendering them. It would be nice if &reg/&174 behaved the same way as &lt and &gt

        Thanks for helping me look at this!