I don't understand args.queryParameters

Hi,
I want to make a simple app with Scriptable, something more than ajust a widget or automation but still not a full-fledged app. I need my application to authorize to a third-party API with Oauth 2, so I have performed the flow but I don’t receive my authorization code in the args.queryParameters array. Here’s my test code

let params = args.queryParameters
Safari.open(authorizationInitURL)
if (params.code == null) {
let a = new Alert()
	a.title = "Test"
	a.message = args.queryParameters.join
	await a.presentAlert()
}

No matters if I use params (the variable I defined), or call args.queryParameters directly, there’s nothing! Even when I try to enter some dummy params by hand, like
scriptable:///run/Test?a=b&c=d, it still does not work. Am I doing something wrong or there’s a bug?

Hello, in another topic Can I run Scriptable scripts via x-callback-url and pass parameters? - #2 by RosemaryOrchard, Simon seems to say that url scheme for parameters is
scriptable:///run?scriptName=Untitled%20Script&foo=hello&bar=world

But my tests are not successful

Correction: it works.

I use a shortcut with
action 1: URL = scriptable:///run?scriptName=Args&foo=hello&bar=world
action 2: Open URL

and a script named Args

alert = new Alert()
alert.title = 'args:'+JSON.stringify(args.queryParameters)
alert.present()

Result is

IMG_1107

There is also URLScheme.forRunningScript(), which gives you the URL to directly start the script. It returns the same as @cvp wrote but dynamically for the current script.