HTTP Interface of the production server
Use the HTTP interface of the production server to make application API requests or web application resource requests. Use the following request structures, headers, and elements.
Application API requests
Use the following request structure to perform an application API request:
{Protocol}://{Worklight Server}/apps/services/api/{Application ID}/{Application Environment}/{Action}
Header Name Data Type Description Valid values x-wl-app-version String Version of the application WL-Instance-ID String Protection mechanism for XSS attacks.
Header Name Data Type Description Valid values Protocol String HTTP Worklight Server String Host name or IP address (and possibly port) identifying the MobileFirst Server Application ID String Unique Identifier of the application within the MobileFirst Server. Every application deployed on the MobileFirst Server must have a unique identifier Up to 256 alphanumeric and underscore characters Application Environment String Name of the environment that the application is running on air, android, Androidnative, blackberry, desktopbrowser, iOSnative, ipad, iphone, JavaMEnative, mobilewebapp, windows8, windowsphone Action String Requested action Details in following table
Action HTTP Request Parameters init POST x, isAjaxRequest – see the following table showing common parameters. heartbeat POST x, isAjaxRequest – see the following table showing common parameters. logactivity POST x, isAjaxRequest – see the following table showing common parameters. activity – string .
query POST x, isAjaxRequest – see the following table showing common parameters.filterList – JSON block parameterList – JSON block
sorterList – JSON block
When the action is query, the request URL has the following structure: …/query/{Adapter Name}/{Procedure Name} where Adapter Name and Procedure Name are strings.
logout POST x, isAjaxRequest - see the following table showing common parameters. login POST x, isAjaxRequest – see the following table showing common parameters. realm – string .
updates POST x, isAjaxRequest – see the following table showing common parameters. skin – current skin name (string)
checksum – the checksum of the current skin (string)
skinLoaderChecksum – the checksum of the skin selection code (string)
getup POST x, isAjaxRequest - see the following table showing common parameters. deleteup POST x, isAjaxRequest – see the following table showing common parameters. userprefkey – the user preference to delete .
getuserinfo POST x, isAjaxRequest – see the following table showing common parameters. getgadgetprefs POST x, isAjaxRequest - see the following table showing common parameters. notifications POST x, isAjaxRequest – see the following table showing common parameters. subscribe – JSON string containing subscribe options
unsubscribe – when specified, designates an unsubscribe action
updateToken – the update notification token (string)
adapter – the name of the notification adapter (string)
eventSource – the name of the notification event source (string)
alias – notification subscription alias (string)
tag – the name of the tag (string)
fbcallback GET or POST x, isAjaxRequest – see the following table showing common parameters. popup – string
composite POST x, isAjaxRequest - see the following table showing common parameters. requests – a JSON string containing information about other actions to invoke.
This action is used to combine several actions in a single HTTP request.
appversionaccess GET x, isAjaxRequest – see the following table showing common parameters. setup POST x, isAjaxRequest - see the following table showing common parameters. userprefs contains JSON pairs of preference key and value
authentication POST x, isAjaxRequest - see the following table showing common parameters. action values are popup, test, or test_img
authenticate POST x, isAjaxRequest - see the following table showing common parameters. This is an empty handler used to allow the client to respond to authentication challenges with a challengeResponse that cannot fit in a single header or when all headers combined are bigger than the limit for header size.
Parameter Values Comments isAjaxRequest true Included with every GET and POST request only from Adobe™ AIR application. _ None Included with every POST request only from Webkit-based browsers and application frameworks: Safari, Chrome, and Adobe AIR.
Web application resource requests
Use the following request structure to submit a web application resource request:
{Protocol}://{Worklight Server}/apps/services/www/{Application ID}/{Application Environment}/{Application Resource Path}
Request elements
See Application API Request Elements for details about the following request elements: Protocol, Worklight Server, Application ID, and Application Environment.
Element Data Type Description Valid Values Application Resource Path String HTML, image, JavaScript, CSS, and any other application resource Example values: img/bg.png, myWidget.html, js/myWidget.js
Preview application resource requests
Use the following request structure to preview application resource requests:
{Protocol}://{Worklight Server}/apps/services/preview/{Application ID}/{Application Environment}/{Application Version}/{Application Resource Path}
Request elements
See Application API Request Elements for details about the following request elements: Protocol, Worklight Server, ApplicationID, and Application Environment.
Element Data Type Description Valid Values Application Resource Path String HTML, image, JavaScript, CSS, and any other application resource Example values: img/bg.png, myWidget.html, js/myWidget.js
Parent topic: Production server endpoints