Understanding how the JSON callback works - Understanding how the JSON callback works - Alfresco - Alfresco Content Services - Alfresco/Alfresco-Content-Services/23.4/Alfresco-Content-Services/Tutorials/Develop-a-Platform-Extension/Repository-Web-Scripts-Tutorials/Creating-a-Hello-User-web-script-with-authentication/Understanding-how-the-JSON-callback-works - 23.4 - 23.4

Alfresco Content Services

Platform
Alfresco
Product
Alfresco Content Services
Release
23.4
License
ft:lastPublication
2026-04-22T22:35:19.567073
ft:locale
en-US

The easiest way to understand the callback example is to invoke the Hello User web script directly and interrogate the response.

Type the following in the command line:

curl -uadmin:admin "http://localhost:8080/alfresco/s/hellouser.json?alf_callback=showGreeting"

This mimics the web script invocation made in the callback.html file.

The response is:

showGreeting({greeting: "hello", user: "admin"})

This is simply the vanilla Hello User web script response passed as an argument to the function named showGreeting as defined by the alf_callback query parameter. The full response is treated as JavaScript by the web browser, which executes it.