A PaaS Method may be called by any other Moxie system. In order to call a PaaS Method from MOX, the PaaS statement is used.
It is common practice for Internet APIs to make use of API Keys for authentication. This approach allows a 3rd party to provide such a key to the called system as proof of authority to act on behalf of the user. Using an API Key provides the user with greater security than methods such as having the user provide his/her username and password to the 3rd party, or using a regular session key that would grant the 3rd party the same access as the user. Thus, the use of API Keys ensures that the user is only granting the 3rd party a limited set of rights based on what the API exposes.
In the case of PaaS Methods, they pull values from the Setup Table of Cnw.PaaS.SaaS and Cnw.PaaS.Key and uses those to authenticate with the PaaS system. Cnw.PaaS.SaaS is the Alias of the SaaS solution, and Cnw.PaaS.Key is an encrypted API key used for this authentication. This works double-duty, in that it enforces authentication on each PaaS call, as well as validating the SaaS solution's Alias for use in the PaaS Methods you call. The system can then use that validated SaaS Alias to determine that other values passed are correctly associated with that SaaS solution and that you have permissions to those resources.
When a Remote Method is initiated, a copy of the Query specified by the InputQuery parameter by the Remote Caller will be in a Query Object named Input and it will be set as the Top Query. Any changes made to this Query will be discarded.
A second Query Object, named Output, initially blank, will be set as the Work Query and this becomes the result/return of the Remote Method. The data in this Query will be returned to the Remote Caller and will be placed into the Query specified by the OutputQuery parameter of the Remote statement.
The Request Query is accessible in the same manner as it is in a Public Method. Any URL Parameters passed as part of the URL string will be parsed and available in the Request Query. For more information about the Request Query see the applicable section under the Public Method topic.
The PaaS call includes several values that are put into the PaaS Method's Request Query that aren't normally there for Remote Methods: