Issues with additionalScope

Hi Retool,

I'm working on a tool that needs to pass in additional scope parameters to a REST API call. I am able to get the API working just fine when I manually code in the strings I am passing in. I have confirmed that the values passed are as expected in the console.

However the additionalScope parameters do not seem to be passed into the REST API and I am receiving errors with the name of the URL as well as the body.

Here is my query that triggers the API call (interstitial is currently hard coded as true and the first if block is the one triggering):

Here is the REST API call:

I understand that the variables will be undefined if I haven't called and passed in the query; however the issue lies when I do call it. Can someone please help me figure out what's going wrong?

Thanks for your help,

Alternatively, if there is a workaround solution to this

@sarah This might sound silly but have you tried defining additionalScope explicitly instead of passing an object? What I mean is to update your code to look like this:

let companyId = appData.user ? appData.user : "";
  additionalScope: {
    ad_type: "interstitial",
    company_id: companyId,
    desiredPRS: desiredPRS,
    pub_rev_share_id: editAppPRS.pub_rev_share_id

I've run into some issues before where simply changing the syntax to be more explicit solves the error even if it's not as clean.

1 Like

Hey @bonnyag, yes I did. It seems like only one is passing correctly, namely pub_rev_share_id - the issue is now with the values in the raw body. Is there a way to see what is being sent as the body on the API query side to further troubleshoot?

As an update, I was able to get it working- not sure how since I have the same configs up but passing in additionalScope helped iron things out. Thank you!

1 Like