FileCloud API - "Hello World" Exercise
"Hello World" for FileCloud is not exactly the program that prints Hello World.
- We will see how to login and authenticate into FileCloud in a default authentication setting.
- These calls are fundamental to understand the XML messages that are used to communicate between the FileCloud server and client.
Authentication is a one step process.
- The loginguest command is issued with account name and password.
- When authentication is complete and successful, the FileCloud HTTP server creates a cookie and returns the cookie value to the client through the HTTP header.
7.1 COMMAND: LOGINGUEST
loginguest command accepts the account name and password and attempts to login into the profile. The URL follows the standard format as we discussed above.
When applied for loginguest call, the above URL takes the form.
http://host:port/core/loginguest
The input parameters (see table below) userid and password must be passed as name/value pairs from client to FileCloud HTTP server as a part of HTML body through the HTTP POST method.
From the FileCloud Client, issue an HTTP POST command with the above URL when your FileCloud Development Instance is running.
<commands> <command> <type>loginguest</type> <result>1</result> <message> </message> </command> </commands>
In the above XML response, RESULT 1 indicates that the profile was logged in successfully. As an additional help, use the FileCloud Logs to follow the communication between your client and FileCloud HTTP server.
Input HTTP, Method: POST
PARAMETER | Required | DATA TYPE | DESCRIPTION |
---|---|---|---|
userid | Yes | String | account name |
password | Yes | String | Clear Text password |
Output
PARAMETER | Description |
---|---|
type | Name of the call. Possible value is "loginguest" |
result | Returns 1 if success, 0 is failed. However, a RESULT 0 indicates the loginguest failed. Most likely cause will be password is not correct. password |
message | Returns any error message generated in the call. 8 FILECLOUD |
7.2 COMMAND: ADMINLOGIN
adminlogin command accepts the admin name and admin password and attempts to login into the admin site. The URL follows the standard format as we discussed above.
When applied for adminlogin call, the above URL takes the form.
http://host:port/admin/?op=adminlogin
The input parameters (see table below) op, adminuser and adminpassword must be passed as name/value pairs from client to FileCloud HTTP server as a part of HTML body through the HTTP POST method.
From the FileCloud Client, issue an HTTP POST command with the above URL when your FileCloud Development Instance is running.
<commands> <command> <type>adminlogin</type> <result>1</result> <message> </message> </command> </commands>
In the above XML response, RESULT 1 indicates that the profile was logged in successfully. As an additional help, use the FileCloud Logs to follow the communication between your client and FileCloud HTTP server.
Input HTTP, Method: POST
PARAMETER | Required | DATA TYPE | DESCRIPTION |
---|---|---|---|
op | Yes | String | Operation |
adminuser | Yes | String | Admin user name |
adminpassword | Yes | String | Clear Text password |
Output
PARAMETER | Description |
---|---|
type | Name of the call. Possible value is "adminlogin" |
result | Returns 1 if success, 0 is failed. However, a RESULT 0 indicates the adminlogin failed. |
message | Returns any error message generated in the call. |