App42 Cloud API

PHP cloud SDK

Gallery

Create Photo Gallery on the cloud. This service allows to manage i.e. create, retrieve and remove albums on the cloud. Its useful for Mobile/Device App and Web App developer who want Photo Gallery functionality. It gives them a complete Photo Gallery out of the box and reduces the footprint on the device. Developers can focus on how the Photo Gallery will be rendered and this Cloud API will manage the Gallery on the cloud thereby reducing development time.Functions available under Gallery API are

In order to use the various functions available under a particular API, a developer will have to create an instance of ServiceAPI by passing the apiKey and the secretKey which has been received while creating an app.

$api = new ServiceAPI("<API_KEY>","<SECRET_KEY>");

After initialization, developer needs to call the buildXXXService method on ServiceAPI instance to get the instance of the particular API that you wish to build. For example, To build an instance of AlbumService, buildAlbumService() method needs to be called.

	 $album = $api->buildAlbumService();

Once the API instance has been retrieved, You are ready to use the functions available for that particular API.

The methods available under a particular API will return the domain object (like Album in this case) as a response which will have the accessor / mutator to access the available properties for that object. You can get the response in the form of JSON as well. We have provided the JSON response with every function detail which can be retrieved by calling the toString() on the returned object.

$userName = "Nick";
$albumName = "MyAlbum";
$albumDescription = "Album Description";

$album = $albumService->createAlbum($userName,$albumName,$albumDescription);  /* returns the Album object. */ 
print_r("userName is " . $album->getUserName());
print_r("albumName is " . $album->getName());
print_r("albumDescription is " . $album->getDescription());
$jsonResponse = $createAlbum->toString(); /* returns the response in JSON format. */ 
                            

These APIs retruns the response in both XML and JSON format. A developer can configure either XML or JSON for output. The sample response for XML as well as JSON has been provided along with the function detail.

The functions available under Gallery API can throw some exceptions in abnormal conditions. Example of the same has been given below.

E.g. If App developer is creating an album for the user which is not in database, the function will throw the App42Exception (as shown below) with message as "Not Found" and the appErrorCode as "2500" and the details as "The request parameters are invalid. Album with the name '<albumName>' for the user '<userName>' already exists.".

The response in case of exception is given below.

JSON Response

$userName = "Nick";
$albumName = "MyAlbum";
$albumDescription = "Album Description";

try{
	$album = $albumService->createAlbum($userName,$albumName,$albumDescription);
} catch(App42Exception $ex) {
	$appErrorCode = $ex->getAppErrorCode();
	$httpErrorCode = $ex->getHttpErrorCode();
	if(appErrorCode == 2500)
{
    // Handle here for Bad Request (The request parameters are invalid. Album with the name '<albumName>' for the user '<userName>' already exists.)
}
    else if(appErrorCode == 1401){
    // handle here for Client is not authorized
}
    else if(appErrorCode == 1500){
    // handle here for Internal Server Error
}
	$jsonText = $ex->getMessage(); /* returns the Exception text in JSON format. (as shown below)*/	
}
                            
	{
		"app42Fault": {
			"httpErrorCode": 404,
			"appErrorCode": 2500,
			"message": "Bad Request",
			"details": "The request parameters are invalid. Album with the name 'MyAlbum' for the user 'Nick' already exists"
		}
	}				

Below are the HTTP Error Codes and their description, the function under the Gallery API can throw.

/*
1400 - BAD REQUEST - The Request parameters are invalid
1401 - UNAUTHORIZED - Client is not authorized
1500 - INTERNAL SERVER ERROR - Internal Server Error. Please try again	
*/						

Below are the Application Error Codes and their description, the function under the Gallery API can throw.

/*
2500 - BAD REQUEST - The request parameters are invalid. Album with the name '<albumName>' for the user '<userName>' already exists. 
2501 - NOT FOUND - Album by the name '<albumName>' for the user '<userName>' does not exist.
2502 - NOT FOUND - Albums for the user '<userName>' do not exist.
2503 - NOT FOUND - Albums and Photos for the user '<userName>' does not exist.
2504 - NOT FOUND - Photo with the name '<photoName>' from the album '<albumName>' for the user '<userName>' does not exist.
2505 - BAD REQUEST - The request parameters are invalid. Photo by the name '<photoName>' for album '<albumName>' for the user '<userName>' already exists.
2506 - NOT FOUND - The number of albums for the user '<userName>' are less than the specified offset : <offset>.
2507 - Album by the name '<albumName>' for the user '<userName>' have less photos than the specified offset : <offset>.
2508 - Not Found - Albums and Photos for the tag <tag> does not exist.
*/						

Various functions available under Gallery API has been explained below.

function createAlbum($userName, $albumName,$albumDescription)

Create Album on the cloud.

Parameters:

userName - The user to which the album belongs.
albumName - Name of the album to be created on the cloud.
albumDescription - Description of the album to be created

Returns:

Album object containing the album which has been created

Response: Album Object

Exception:

This method throws following exception.
/*
2500 - BAD REQUEST - The request parameters are invalid. Album with the name '<albumName>' for the user '<userName>' already exists.
*/		        
For more details click Exception
$userName = "Nick";
$albumName = "MyAlbum";
$albumDescription = "Album Description";	
						
$album = $albumService->createAlbum($userName,$albumName,$albumDescription);  /* returns the Album object. */ 
print_r("userName is " . $album->getUserName());
print_r("albumName is " . $album->getName());
print_r("albumDescription is " . $album->getDescription()); 
$jsonResponse = $album->toString(); /* returns the response in JSON format. (as shown below)*/
                            
{
    "app42": {
        "response": {
            "success": true,
            "albums": {
                "album": {
                    "userName": "Nick",
                    "name": "MyAlbum",
                    "description": "Album Description"
                }
            }
        }
    }
}
function getAlbums($userName)

Fetches all the Albums based on the userName

Parameters:

userName - The user for which the albums have to be fetched

Returns:

Album object containing all the album for the given userName

Response: Album Object

Exception:

This method throws following exception.
/*
2502 - NOT FOUND - Albums for the user '<userName>' do not exist. 
*/		        
For more details click Exception
$userName = "Nick";	

$albumList = $albumService->getAlbums($userName); /* returns the list of Album objects. */
foreach( $albumList as $album ){
print_r("albumName is " . $album->getName());
print_r("userName is " . $album ->getUserName()); 
print_r("description is " . $album ->getDescription()); 
}
$jsonResponse = $albumList[i]->toString(); /* returns the response in JSON format. (as shown below)*/

                            
{
    "app42": {
        "response": {
            "success": true,
            "albums": {
                "album": [
                    {
                        "userName": "Nick",
                        "name": "MyAlbum",
                        "description": "Album Description"
                    },
                    {
                        "userName": "Nick",
                        "name": "Album091",
                        "description": "Album Description"
                    }
                ]
            }
        }
    }
}

function getAlbumsCount($userName)

Fetches the count of all the Albums based on the userName

Parameters:

userName - The user for which the count of albums have to be fetched

Returns:

App42Response object containing the count of all the album for the given userName

Response: App42Response Object

For more details click Exception
$userName = "Nick";	
					
$response = $albumService->getAlbumsCount($userName); /* returns the App42Response objects. */
$success = $response->isResponseSuccess();
$totalRecords = $response->getTotalRecords();
$jsonResponse = $response->toString(); /* returns the response in JSON format. (as shown below)*/ 
{
    "app42": {
        "response": {
            "success": true,
            "totalRecords": 3
        }
    }
}
function getAlbums($userName,$max, $offset)

Fetches all the Albums based on the userName by Paging.

Parameters:

userName - The user for which the albums have to be fetched
max - Maximum number of records to be fetched
offset - From where the records are to be fetched

Returns:

Album object containing all the album for the given userName

Response: Album Object

Exception:

This method throws following exception.
/*
2506 - NOT FOUND - The number of albums for the user '<userName>' are less than the specified offset : '<offset>'.
*/		        
For more details click Exception
$userName = "Nick";
$max = 1;
$offset = 0;	
					
$albumList = $albumService->getAlbums($userName,$max,$offset); /* returns the list of Album objects. */
foreach($albumList as $album){
print_r("albumName is " . $album->getName());
print_r("userName is " . $album ->getUserName()); 
print_r("description is " . $album ->getDescription()); 
}
$jsonResponse = $albumList->toString(); /* returns the response in JSON format. (as shown below)*/

                            
{
    "app42": {
        "response": {
            "success": true,
            "albums": {
                "album": [
                    {
                        "userName": "Nick",
                        "name": "MyAlbum",
                        "description": "Album Description"
                    },
                    {
                        "userName": "Nick",
                        "name": "Partyalbum",
                        "description": "Album Description"
                    }
                ]
            }
        }
    }
}
function getAlbumByName($userName, $albumName)

Fetch all Album based on the userName and albumName.

Parameters:

userName - The user for which the album has to be fetched
albumName - Name of the album that has to be fetched

Returns:

Album object containing album for the given userName and albumName

Response: Album Object

Exception:

This method throws following exception.
/*
2501 - NOT FOUND - Album by the name '<albumName>' for the user '<userName>' does not exist. 
*/		       
For more details click Exception
$userName = "Nick";
$albumName = "MyAlbum";	
					
$album = $albumService->getAlbumByName($userName,$albumName);  /* returns the Album object. */ 
print_r("albumName is " . $album->getName());
print_r("userName is " . $album ->getUserName()); 
print_r("description is " . $album ->getDescription());
$jsonResponse = $album->toString(); /* returns the response in JSON format. (as shown below)*/
{
    "app42": {
        "response": {
            "success": true,
            "albums": {
                "album": {
                    "userName": "Nick",
                    "name": "MyAlbum",
                    "description": "Album Description"
                }
            }
        }
    }
}
function removeAlbum($userName,$albumName)

Removes the album based on the userName and albumName.
Note: All photos added to this Album will also be removed

Parameters:

userName - The user for which the album has to be removed
albumName - Name of the album that has to be removed

Returns:

App42Response if removed successfully

Response: App42Response Object

Exception:

This method throws following exception.
/* 
2501 - NOT FOUND - Album by the name '<albumName>' for the user '<userName>' does not exist. 
*/		       
For more details click Exception
$userName = "Nick";
$albumName = "MyAlbum";

$response = $albumService->removeAlbum($userName, $albumName); /* returns the App42Response object. */
$success = $response->isResponseSuccess();
$jsonResponse = $response->toString(); /* returns the response in JSON format. (as shown below)*/
                            
{
    "app42": {
        "response": {
            "success": true,
            "albums": {
                "album": {
                    "userName": "Nick",
                    "name": "MyAlbum",
                    "description": "Album Description",
                    "photos": {
                        "photo": {
                            "name": "Photo091",
                            "description": "Photo Details",
                            "url": "http://XXXX.png",
                            "thumbNailUrl": null
                        }
                    }
                }
            }
        }
    }
}
function addPhoto($userName, $albumName, $photoName, $photoDescription, $path)

Adds Photo for a particular user and album. The Photo is uploaded on the cloud.

Parameters:

userName - Name of the User whose photo has to be added
albumName - Name of the Album in which photo has to be added
photoName - Name of the Photo that has to be added
photoDescription - Description of the Photo that has to be added
path - Path from where Photo has to be picked for addition

Returns:

Album object containing the Photo which has been added

Response: Album Object

Exception:

This method throws following exception.
/* 
2501 - NOT FOUND - Album by the name '<albumName>' for the user '<userName>' does not exist. 
2505 - BAD REQUEST - The request parameters are invalid. Photo by the name '<photoName>' for album '<albumName>' for the user '<userName>' already exists.
*/		        
For more details click Exception
$userName = "Nick";
$albumName = "MyAlbum";
$photoName = "Photo091";
$photoDescription = "Photo Details";
$path	= "Local file path";

$album = $photoService->addPhoto($userName,$albumName,$photoName,$photoDescription,$path);  /* returns the Album object. */ 
print_r("albumName is " . $album->getName());
print_r("userName is " . $album ->getUserName()); 
print_r("description is " . $album ->getDescription()); 
$photoList = $album->getPhotoList();  
foreach( $photoList as $photo ){
print_r("albumName is " . $photo->getName());
print_r("description is " . $photo ->getDescription());
}
$jsonResponse = $album->toString(); /* returns the response in JSON format. (as shown below)*/ 
{
    "app42": {
        "response": {
            "success": true,
            "albums": {
                "album": {
                    "userName": "Nick",
                    "name": "MyAlbum",
                    "description": "Album Description",
                    "photos": {
                        "photo": {
                            "name": "Photo091",
                            "description": "Photo Details",
                            "url": "http://XXXX.png",
                            "thumbNailUrl": "http://XXXX-thumbnail.png"
                        }
                    }
                }
            }
        }
    }
}
function addTagToPhoto($userName, $albumName, $photoName, $tagList)

Adds Photo for a particular user and album. The Photo is uploaded on the cloud.

Parameters:

userName - Name of the User whose name has to be tagged to photo
albumName - Album name whose photo is to be tagged
photoName - Photo name to be tagged
tagList - List of tags in Photo

Returns:

Album object containing the Photo which has been added

Response: Album Object

Exception:

This method throws following exception.
/*
2501 - NOT FOUND - Album by the name '<albumName>' for the user '<userName>' does not exist. 
2504 - NOT FOUND - Photo with the name '<photoName>' from the album '<albumName>' for the user '<userName>' does not exist.
*/ 
For more details click Exception
$userName = "Nick";
$albumName = "MyAlbum";
$photoName = "PhotoName_01";
$tagList = array();
array_push($tagList,"John");

$album = $photoService->addTagToPhoto($userName,$albumName,$photoName,$tagList);  /* returns the Album object. */ 
print_r("albumName is " . $album->getName());
print_r("userName is " . $album ->getUserName()); 
print_r("description is " . $album ->getDescription()); 
$photoList = $album->getPhotoList();  
foreach( $photoList as $photo ){
print_r("albumName is " . $photo->getName());
print_r("description is " . $photo ->getDescription());
}
$jsonResponse = $album->toString(); /* returns the response in JSON format. (as shown below)*/
                            
{
    "app42": {
        "response": {
            "success": true,
            "albums": {
                "album": {
                    "userName": "Nick",
                    "name": " MyAlbum",
                    "description": "Album Description",
                    "photos": {
                        "photo": {
                            "name": "PhotoName_01.png",
                            "description": "Photo DESC",
                            "url": "http://XXXX.png",
                            "tinyUrl": "http://tinyurl.com/cr8z9gk",
                            "thumbNailUrl": "http://XXXX-thumbnail.png",
                            "thumbNailTinyUrl": "http://tinyurl.com/csw4mqz",
                            "tags": "TagName_01"
                        }
                    }
                }
            }
        }
    }
}

function getPhotos($userName)

Fetch all the Photos based on the userName.

Parameters:

userName - Name of the User whose photos have to be fetched

Returns:

ArrayList of Album object containing all the Photos for the given userName

Response: Album Object

Exception:

This method throws following exception.
/*
2503 - NOT FOUND - Albums and Photos for the user '<userName>' does not exist. 
*/		        
For more details click Exception
$uName = "Nick";

$albumList = $photoService->getPhotos($uName); /* returns the list of Album objects. */
foreach( $albumList as $album ){
print_r("albumName is " . $album->getName());
print_r("userName is " . $album ->getUserName()); 
print_r("description is " . $album ->getDescription()); 
$photoList = $album->getPhotoList();  
foreach( $photoList as $photo ){
print_r("albumName is " . $photo->getName());
print_r("description is " . $photo ->getDescription());
}	
}
$jsonResponse = $albumList->toString(); /* returns the response in JSON format. (as shown below)*/

                            
  {
    "app42": {
        "response": {
            "success": true,
            "albums": {
                "album": [
                    {
                        "userName": "Nick",
                        "name": "MyAlbum",
                        "description": "Album Description",
                        "photos": {
                            "photo": [
                                {
                                    "name": "Photo090",
                                    "description": "Photo Description",
                                    "url": "http://XXXX.jpg",
                                    "thumbNailUrl": "http://XXXX-thumbnail.jpg"
                                },
                                {
                                    "name": "Photo091",
                                    "description": "Photo Details",
                                    "url": "http://YYYY.png",
                                    "thumbNailUrl": "http://YYYY-thumbnail.png"
                                }
                            ]
                        }
                    },
                    {
                        "userName": "Jack",
                        "name": "Album091",
                        "description": "Album Description"
                    }
                ]
            }
        }
    }
}


function getTaggedPhotos($userName,$tag)

Fetch all the Photos based on the userName and tag.

Parameters:

userName - Name of the User whose photos have to be fetched
tag - Tag on which basis photos have to be fetched

Returns:

List of Album object containing all the Photos for the given userName

Response: Album Object

Exception:

This method throws following exception.
/*
2503 - NOT FOUND - Albums and Photos for the user '<userName>' does not exist. 
2508 - NOT FOUND - Albums and Photos for the tag <tag> does not exist.
*/		        
For more details click Exception
$userName = "Nick";
$tag = "joy";

$albumList = $photoService->getTaggedPhotos($uName); /* returns the list of Album objects. */
foreach( $albumList as $album ){
print_r("albumName is " . $album->getName());
print_r("userName is " . $album ->getUserName()); 
print_r("description is " . $album ->getDescription()); 
$photoList = $album->getPhotoList();  
foreach( $photoList as $photo ){
print_r("albumName is " . $photo->getName());
print_r("description is " . $photo ->getDescription());
}
}
$jsonResponse = $albumList->toString(); /* returns the response in JSON format. (as shown below)*/

                            
  {
    "app42": {
        "response": {
            "success": true,
            "albums": {
                "album": {
                    "userName": "Nick",
                    "name": "MyAlbum",
                    "description": "MyAlbum description",
                    "photos": {
                        "photo": {
                            "name": "myPhoto",
                            "description": "photo at Tour",
                            "url": "http://XXXX.jpg",
                            "tinyUrl": "http://tinyurl.com/78c4mwp",
                            "thumbNailTinyUrl": "http://tinyurl.com/7agsvc6",
                            "thumbNailUrl": "http://XXXX-thumbnail.jpg",
                            "tags": "joy"
                        }
                    }
                }
            }
        }
    }
}


function getPhotosByAlbumName($userName, $albumName)

Fetch all Photos based on the userName and album name

Parameters:

userName - Name of the User whose photos have to be fetched
albumName - Name of the Album from which photos have to be fetched

Returns:

Album object containing all the Photos for the given userName and albumName

Response: Album Object

Exception:

This method throws following exception.
/* 
2501 - NOT FOUND - Album by the name '<albumName>' for the user '<userName>' does not exist. 
*/		        
For more details click Exception
$uName = "Nick";
$albumName = "MyAlbum";					
$album = $photoService->getPhotosByAlbumName($uName,$albumName);  /* returns the Album object. */ 
print_r("albumName is " . $album->getName());
print_r("userName is " . $album ->getUserName()); 
print_r("description is " . $album ->getDescription()); 
$photoList = $album->getPhotoList();  
foreach( $photoList as $photo ){
print_r("albumName is " . $photo->getName());
print_r("description is " . $photo ->getDescription());
}
$jsonResponse = $album->toString(); /* returns the response in JSON format. (as shown below)*/
                            
{
    "app42": {
        "response": {
            "success": true,
            "albums": {
                "album": {
                    "userName": "Nick",
                    "name": "MyAlbum",
                    "description": "Album Description",
                    "photos": {
                        "photo": [
                            {
                                "name": "Photo090",
                                "description": "Photo Description",
                                "url": "http://XXXX.jpg",
                                "thumbNailUrl": "http://XXXX-thumbnail.jpg"
                            },
                            {
                                "name": "Photo091",
                                "description": "Photo Details",
                                "url": "http://YYYY.png",
                                "thumbNailUrl": "http://YYYY-thumbnail.png"
                            }
                        ]
                    }
                }
            }
        }
    }
}
$getPhotosCountByAlbumName($userName, $albumName)

Fetch the count of all Photos based on the userName and album name

Parameters:

userName - Name of the User whose count of photos have to be fetched
albumName - Name of the Album from which count of photos have to be fetched

Returns:

App42Response object containing the count of all the Photos for the given userName and albumName

Response: App42Response Object

For more details click Exception
$userName = "Nick";
$albumName = "MyAlbum";						
$response = $photoService->getPhotosCountByAlbumName($userName,$albumName); /* returns the App42Response objects. */
$success = $response->isResponseSuccess();
$totalRecords = $response->getTotalRecords();
$jsonResponse = $response->toString(); /* returns the response in JSON format. (as shown below)*/
                            
{
   "app42": {
       "response": {
           "success": true,
           "totalRecords": 3
       }
   }
}
$getPhotosByAlbumName($userName, $albumName, $max, $offset)

Fetch all Photos based on the userName and album name by paging.

Parameters:

userName - Name of the User whose photos have to be fetched
albumName - Name of the Album from which photos have to be fetched
max - Maximum number of records to be fetched
offset - From where the records are to be fetched

Returns:

Album object containing all the Photos for the given userName and albumName

Response: Album Object

Exception:

This method throws following exception.
/*
2501 - NOT FOUND - Album by the name '<albumName>' for the user '<userName>' does not exist. 
2507 - NOT FOUND - Album by the name '<albumName>' for the user '<userName>' have less photos than the specified offset : '<offset>'.
*/		        
For more details click Exception
$userName = "Nick";
$albumName = "MyAlbum";
$max = 1;
$offset = 0;

$album = $photoService->getPhotosByAlbumName($userName,$albumName,$max,$offset);  /* returns the Album object. */ 
print_r("albumName is " . $album->getName());
print_r("userName is " . $album ->getUserName()); 
print_r("description is " . $album ->getDescription()); 
$photoList = $album->getPhotoList();  
foreach( $photoList as $photo ){
print_r("albumName is " . $photo->getName());
print_r("description is " . $photo ->getDescription());
}
$jsonResponse = $album->toString(); /* returns the response in JSON format. (as shown below)*/
                            
{
   "app42": {
       "response": {
           "success": true,
           "albums": {
               "album": {
                   "userName": "Nick",
                   "name": "MyAlbum",
                   "description": "Album Description",
                   "photos": {
                       "photo": {
                           "name": "photoName1",
                           "description": "welcome",
                           "url": "http://XXXX.jpg",
                           "thumbNailUrl": "http://XXXX-thumbnail.jpg"
                       }
                   }
               }
           }
       }
   }
}
function getPhotosByAlbumAndPhotoName($userName, $albumName, $photoName)

Fetch the particular photo based on the userName, album name and photo name

Parameters:

userName - Name of the User whose photo has to be fetched
albumName - Name of the Album from which photo has to be fetched
photoName - Name of the Photo that has to be fetched

Returns:

Album object containing the Photo for the given userName, albumName and photoName

Response: Album Object

Exception:

This method throws following exception.
/*
2501 - NOT FOUND - Album by the name '<albumName>' for the user '<userName>' does not exist. 
2504 - NOT FOUND - Photo with the name '<photoName>' from the album '<albumName>' for the user '<userName>' does not exist.
*/		        
For more details click Exception
$userName = "Nick";
$albumName = "MyAlbum";
$photoName = "Photo091";
$album = $photoService->getPhotosByAlbumAndPhotoName($userName,$albumName,$photoName);  /* returns the Album object. */ 
print_r("albumName is " . $album->getName());
print_r("userName is " . $album ->getUserName()); 
print_r("description is " . $album ->getDescription()); 
$photoList = $album->getPhotoList();  
foreach( $photoList as $photo ){
print_r("albumName is " . $photo->getName());
print_r("description is " . $photo ->getDescription());
} 
$jsonResponse = $album->toString(); /* returns the response in JSON format. (as shown below)*/
                            
{
    "app42": {
        "response": {
            "success": true,
            "albums": {
                "album": {
                    "userName": "Nick",
                    "name": "MyAlbum",
                    "description": "Album Description",
                    "photos": {
                        "photo": {
                            "name": "Photo091",
                            "description": "Photo Details",
                            "url": "http://XXXX.png",
                            "thumbNailUrl": "http://XXXX.png"
                        }
                    }
                }
            }
        }
    }
}
function removePhoto($userName, $albumName, $photoName)

Removes the particular Photo from the specified Album for a particular user.
Note: The Photo is removed from the cloud and wont be accessible in future

Parameters:

userName - Name of the User whose photo has to be removed
albumName - Name of the Album in which photo has to be removed
photoName - Name of the Photo that has to be removed

Returns:

App42Response if removed successfully

Response: App42Response Object

Exception:

This method throws following exception.
/*
2501 - NOT FOUND - Album by the name '<albumName>' for the user '<userName>' does not exist. 
2504 - NOT FOUND - Photo with the name '<photoName>' from the album '<albumName>' for the user '<userName>' does not exist.
*/		       
For more details click Exception
$userName = "Nick";
$albumName = "MyAlbum";
$photoName = "Album Description";
	
$response = $photoService->removePhoto($userName, $albumName, $photoName); /* returns the App42Response object. */
$success = $response->isResponseSuccess();
$jsonResponse = $response->toString(); /* returns the response in JSON format. (as shown below)*/
                            
{
    "app42": {
        "response": {
            "success": true,
            "albums": {
                "album": {
                    "userName": "Nick",
                    "name": "MyAlbum",
                    "description": "Album Description",
                    "photos": {
                        "photo": {
                            "name": "Photo090",
                            "description": "Photo Description",
                            "url": "http://XXXX.jpg",
                            "thumbNailUrl": "http://XXXX.jpg"
                        }
                    }
                }
            }
        }
    }
}