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-09-2022 01:40 PM
Oh I apologize for the confusion, I already had that specific header in place We are successfully using the account.username and account.password in another pipeline i.e. in the HTTP entity field of the POST snap.
03-09-2022 02:09 PM
Wow! You’re right. I guess I hadn’t tried it with exactly the right syntax. This expression works just fine in the HTTP Entity field:
"grant_type=password&username=" + account.username +"&password=" + encodeURIComponent(account.password)
03-09-2022 03:16 PM
Oh yeah the statement itself validates, but I am still getting a 400 bad request error
03-09-2022 03:30 PM
Let’s see a screenshot of your REST Post snap settings.
03-10-2022 01:09 AM
@jsmith141 You can try removing the account from the REST Post snap and send the account username and password through pipelines parameters to check if it’s working.