03-09-2022 11:43 AM
Hi,
This is a very novice question, but I am having trouble with a post request snap. This is just to authenticate with the RingCentral platform to receive a token for API consumption. I am able to successfully retrieve an access token when calling the oauth/token endpoint in Postman. The issue arises when I try to move this post call into SnapLogic. The call requires certain parameters to be passed through the body and I am not sure how to duplicate this in SnapLogic post snap. Please see the screenshot of the Postman call Body tab below.
I have created a basic account in SnapLogic to store the username and password and my post snap references that account. I am also aware that the credentials of a basic account can be accessed using the “Account.Username” and Account.Password" of the respective referenced account within the snap.
I am just not sure how to build out the body section in the “x-www-form-urlencoded” format as shown in the screenshot? The error I get back when validating this post snap is just a 400: Bad Request.
Any insight/help that anyone could provide would be greatly appreciated. Please let me know if additional information is needed to provide assistance.
Thanks,
James
03-10-2022 07:28 AM
Let’s test that theory: Add an Authorization header to the version that works, to see if it breaks.
03-10-2022 07:31 AM
The Authorization header added by the Basic Auth account would have a value like
Basic bXl1c2VyOm15cCZzc3cwcmQ=
03-10-2022 08:38 AM
So after you perform the steps as described in my previous post you do end up with a string that looks like that. Ending with ‘==’
03-10-2022 09:08 AM
Ok, so the account is overwriting the other Authorization header that you added in the Headers section of the snap.
But if one of the components of the Authorization header that you’re adding manually is a client secret that presumably you want to protect, how are you storing that securely? Don’t you have the same issue as with the password?
03-10-2022 09:41 AM
I have to confess that I am not sure how to handle this type of data my experience with SnapLogic is still in its infancy. Using postman to initially test I just use environment variables. Right now in SnapLogic, I am just handling it directly in a mapper snap. I haven’t really seen any documentation that discusses how to handle the various credentials you may need to store when consuming 3rd party APIs within the SnapLogic platform. I believe that an OAuth2.0 SnapLogic account would store this information, but I don’t think it would work overall because of the delivery expected on the RingCentral side, among other requirements for creating an OAuth2.0 account.
Any guidance you could provide would be much appreciated?