Javascript Action Question

I’m trying to integrate the Chargebee portal into my site. It’s pretty straightforward as you just have to include a script in your header, and then add a button that when clicked does SSO into their portal. I included the header script on the page, and also tried globally.

One thing I’m not sure about, when is how to properly integrate the Portal Button Code section,

I tried using Custom HTML to paste this code in, but nothing is happening when I click the link. Any idea on how to properly implement this line of code in Weweb?

Code added with global settings or page settings is not loaded in the editor but it will load in the live app. Probably this is the reason your link it’s not working.

If you want it to load in the editor you can try inserting the script into an html element and see if it works, see here as well.

Yeah I tried in my published application, it just opens a new tab straight back to weweb. In terms of custom module, haven’t really built anything like that, big learning curve, but will look into it.

Maybe the problem is that the library is scanning the page for the link but it’s not there yet.

Check the reference of the library, maybe there is a method to initiate the scanning again.

I think you may be right, it looks like i need to initiate the session, right now it’s prob just kicking back nothing.

I need to make this REST API call in WeWeb, any idea on how to translate what’s shown here into a REST request? I can’t seem to get the AUTH working. (Keys are just dummy)

what did you try?

It should be basic access authorization with just username, so you need a Authorization header with value Basic yourapikey:

Yep that is exactly what I’m trying, not entirely sure what I’m doing wrong. I’ve confirmed this same works when sending through some CURL


message: “Sorry,authentication failed. The authorization header for basic authentication not present in request”

api_error_code: “api_authentication_failed”

error_code: “api_authentication_required”

error_msg: “Sorry,authentication failed. The authorization header for basic authentication not present in request”

The header name should be Authorization.

In your screenshot you have “authentication” that’s why the error says it’s not present.

Ah good catch, OK so fixed that, but what is odd is that I’m getting API authentication failed ‘Invalid API Key’ - But what is odd is that I’m using that same key in Insomnia to test the API, and it’s working just fine. Is there any formatting that needs to be done on the value outside of Basic key:

I also noticed these different content types, would this just be default in most cases?


I guess you should find all the details in the documentation of the API you are calling.
Do you have a way to export the details of the request from Insomnia?

Good news, I was able to get Authentication working. What I found was that it appears Insomnia is encoding the API key to something else before sending, when I use that encoded key which Insomnia API spits out in Weweb, it works.

The only thing I’m trying to figure out at this point is passing parameters which doesn’t appear to work. I’m trying to pass this -d customer[id] value, but doesn’t appear to be taking it.



-d is part of the curl command, not the key value

1 Like

Remove it and it’s working, thank you so much!!!

1 Like