cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Passing Body Content in Post Snap

jsmith141
New Contributor III

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.

image

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

48 REPLIES 48

Letโ€™s test that theory: Add an Authorization header to the version that works, to see if it breaks.

The Authorization header added by the Basic Auth account would have a value like

Basic bXl1c2VyOm15cCZzc3cwcmQ=

jsmith141
New Contributor III

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 โ€˜==โ€™

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?

jsmith141
New Contributor III

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?