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

When I was playing around, it seemed you could change auth type fairly easily, hope this works for you!

You mean on the RingCentral side right?

jsmith141
New Contributor III

Yes you are right. It was easy to switch on the RingCentral side. Let me see if I can get it to work in SnapLogic now.

jsmith141
New Contributor III

Okay some good news. I have made the changes and it looks like I am successfully authenticating with RingCentral. After doing so, I checked the box indicating to auto refresh the token, so that the authentication step does not have to be manually performed by a user. However, when I validate the pipeline I get a message back that says…

\n “errorCode” : “InsufficientPermissions”,\n “message” : “In order to call this API endpoint, application needs to have [EditAccounts] permission”,\n “errors” : [ {\n “errorCode” : “CMN-401”,\n “message” : “In order to call this API endpoint, application needs to have [EditAccounts] permission”,\n “permissionName” : “EditAccounts”\n } ],\n “permissionName” : “EditAccounts”\n}

This indicates that in the application on the RIngCentral side additional permissions are needed. I have to point out though that this call works perfectly in Postman with the current permissions and this particular permission of “EditAccounts” is not even an option in my app on the RingCentral side.

Do you happen to know what might be causing this particular message? Or what we need to look at next to get a successful call?

It appears to be an application permission issue, you can see those in the “Security” section below where you set your authentication, they have explanations for them all here but this is getting more into RingCentral-specific items, which I don’t have any real experience with, unfortunately.

Now that you have those items working, you MIGHT be able to get password auth working, I did some messing around with it, but again since I don’t have a working Sandbox Account, I can’t verify, that setup would be similar to this setup, but would require you to select “password” as your Grant type, in this case, I’m using a dummy phone number 555-555-5555, but for me even with my normal login credentials to the console, I don’t have it working and it seems to be due specifically to the account itself, not the application. The important piece here again is “Send Client Data as Basic Auth header” it’s what sends the client id and secret to the password endpoint within the header of the request. You’d have to go back to your old application for this to work and make sure you set the client id and secret appropriately for the request. This ONLY makes a call to the token endpoint, but I just used the same url for both the auth and token config.
image

For specific endpoints and permissions/scopes, you may need to look at that specific endpoint documentation to know specifically, but for instance, I don’t see “Edit Account” in my options, so my new account must not be set up well enough. for the Password setup. You might be able to add all available scopes from the “Security” section to your other setup to get it working fine, though.
image