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

As I was typing the ticket out, I realized that I was making an endpoint call using a POST snap that should have been a GET snap. With the type of account we used (an Ouath2.o account) I no longer needed the post snap at all. I did not realize that until now. The way we have always built these pipelines out is to setup a POST snap to get a token back, but this account type takes care of that for you

Once I compensated for that fact and switched to a GET snap with the same account, it worked as expected.

Thank you both so much for all of your help. I apologize for getting mixed up and hanging on to the POST snap like that and that it took me so long to realize what was going on at the end there.

Again thank you @ddellsperger and @ptaylor!

Best,
James

Happy that we could resolve things, the OAuth2 Accounts are a little complex because there’s so much to them, but they’re very powerful with more and more services.

I still strongly suggest looking into the OpenAPI Snap if you’re going to be doing a lot of calls through RingCentral and are trying to do some investigating. There’s a link to the swagger specification which is OpenAPI compatible at the top of this page and you can simply use that OpenAPI snap and it provides suggestions for the paths within the spec in place with the methods that you need. You’d just have to update your redirect URI if you use authorization_code for the Open API OAuth account (ending in openapi rather than rest).

Sorry for the delay in response. Would the OpenAPI snap help us avoid some of the 401 errors I am still seeing on the RingCentral app analytic side? In order for an app to be promoted into production it has to have a <5% 4XX return code on all used end points for that app. I have this pipeline set to run every hour, but it looks like the call frequently fails with a 401, but then it retries and is successful, as best as I can tell.

image

image

Please let me know if this needs to be a different thread. I just noticed this morning that we are not meeting this last requirement.

Thanks,
James

I would assume your 401 errors have corresponding failed pipeline runs, if that’s the case, you might be able to investigate the specific causes of those, but I don’t think OpenAPI vs. Rest would really help you there.
You could set the snap retry policy to include auth errors in addition to connection errors, but it all depends what the actual 401 error is that’s coming back, and there should be respective failed pipelines that might help to figure out the specific conditions that are failing.
image

that’s the thing. I don’t see any corresponding failed pipeline runs? Is there something I need to change to get it monitor at a “lower level”?