App42 Cloud API

Windows Phone 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.

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

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.

	AlbumService albumService = api.BuildAlbumService();

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

The Windows Phone API's work in an asynchronous mode that means the response will not be available immediately and all the API methods would not return any value and have return type as void. The response will be returned in callback methods which the caller will provide to the calling method.
As mentioned above that the response will be returned in callback methods, every API method is taking instance of App42Callback (as the last parameter) which will have the implementation of 2 methods: OnSuccess & OnException.(as shown below)

public class CallBack : App42Callback
{
public override void OnSuccess(Object obj)
{
Album album = (Album) obj;
//Do whatever you want with the user object
}
public override void OnException(App42Exception e)
{
//Do whatever you want with the exception
}
}

The callback methods will return the response in the form of Object which will have to be type cast to the object domain object (e.g. App42Response / Album / IList in this case) The Domain object 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.

public override void OnSuccess(Object obj)
{
Album album = (Album) obj; 
Console.WriteLine("userName is " + album.GetName());
Console.WriteLine("albumName is " + album.GetName());
Console.WriteLine("albumDescription is " + album.GetDescription()); 
String jsonResponse = album.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 "BAD REQUEST" 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.".

public override void OnException(App42Exception ex)
{
int appErrorCode = ex.GetAppErrorCode();
int httpErrorCode = ex.GetHttpErrorCode();
String 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 - NOT FOUND - 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.

public void CreateAlbum(String userName, String albumName, String albumDescription, App42Callback requestCallback)

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
requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

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
String userName = "Nick";
String albumName = "MyAlbum";
String albumDescription = "Album Description";

albumService.CreateAlbum(userName,albumName,albumDescription,requestCallback);  /* returns the Album object. */ 
OnSuccess(Object obj)
{
Album album = (Album) obj;
Console.WriteLine("userName is " + album.GetName());
Console.WriteLine("albumName is " + album.GetName());
Console.WriteLine("albumDescription is " + album.GetDescription());
String 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"
                }
            }
        }
    }
}
public void GetAlbums(String userName, App42Callback requestCallback)

Fetches all the Albums based on the userName

Parameters:

userName - The user for which the albums have to be fetched
requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

Returns:

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

Response: IList<Album> Object

Exception:

This method throws following exception.
/*
2502 - NOT FOUND - Albums for the user <userName> do not Exist 
*/		        
For more details click Exception
String userName = "Nick";
						
albumService.GetAlbums(userName,requestCallback); /* returns the list of Album objects. */
OnSuccess(Object obj)
{
IList<Album> albumList = (IList<Album>) obj;
for(int i=0;i <albumList.Count;i++)
{
Console.WriteLine("userName is " + albumList[i].GetUserName());
Console.WriteLine("albumName is " +albumList[i].GetName());
Console.WriteLine("albumDescription is " +albumList[i].GetDescription());
}
String 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": "Album091",
                        "description": "Album Description"
                    }
                ]
            }
        }
    }
}
public void GetAlbumsCount(String userName, App42Callback requestCallback)

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
requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

Returns:

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

Response: App42Response Object

For more details click Exception
String userName = "Nick";
						
albumService.GetAlbumsCount(userName,requestCallback); /* returns the list of Album objects. */
OnSuccess(Object obj)
{
App42Response response = (App42Response) obj;
Boolean success = response.IsResponseSuccess();
int totalRecords = response.GetTotalRecords();  
String jsonResponse = response.ToString(); /* returns the response in JSON format. (as shown below)*/
}
{
    "app42": {
        "response": {
            "success": true,
            "totalRecords": 3
        }
    }
}
public void GetAlbums(String userName,int max, int offset, App42Callback requestCallback)

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
requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

Returns:

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

Response: IList<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
String userName = "Nick";
int max = 1;
int offset = 0;

albumService.GetAlbums(userName,max,offset,requestCallback); /* returns the list of Album objects. */
OnSuccess(Object obj)
{
IList<Album> albumList = (IList<Album>) obj;
for(int i=0;i< albumList.Count;i++)
{
Console.WriteLine("userName is " + album.GetUserName());
Console.WriteLine("albumName is " + album.GetName());
Console.WriteLine("albumDescription is " + album.GetDescription()); 
}
String 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"
                    }
                ]
            }
        }
    }
}
public void GetAlbumByName(String userName, String albumName, App42Callback requestCallback)

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
requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

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
String userName = "Nick";
String albumName = "MyAlbum";		

albumService.GetAlbumByName(userName,albumName,requestCallback);  /* returns the Album object. */ 
OnSuccess(Object obj)
{
Album album = (Album) obj;
Console.WriteLine("userName is " + album.GetUserName());
Console.WriteLine("albumName is " + album.GetName());
Console.WriteLine("albumDescription is " + album.GetDescription()); 
String 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"
                }
            }
        }
    }
}
public void RemoveAlbum(String userName, String albumName, App42Callback requestCallback)

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
requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.
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
String userName = "Nick";
String albumName = "MyAlbum";

albumService.RemoveAlbum(userName,albumName,requestCallback); /* returns the App42Response object. */
OnSuccess(Object obj)
{
App42Response response = (App42Response) obj;
Boolean success = response.IsResponseSuccess();
String 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
                        }
                    }
                }
            }
        }
    }
}
public void AddPhoto(String userName, String albumName, String photoName, String photoDescription, Stream stream, App42Callback requestCallback)

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
stream - Sequence of bytes of photo from where Photo has to be picked for addition
requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

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. Album with the name {albumName} for the user <userName> the photo by the name {photoName} already Exists
*/		        
For more details click Exception
String userName = "Nick";
String albumName = "MyAlbum";
String photoName = "Photo091";
String photoDescription = "Photo Details";
String path	= "Local file path";

photoService.AddPhoto(userName,albumName,photoName,photoDescription,path,requestCallback);  /* returns the Album object. */ 
OnSuccess(Object obj)
{
Album album = (Album) obj;
String albumName = album.GetName();
String albumDescription = album.GetDescription();
IList<Album.Photo> photoList = album.GetPhotoList();
for(int i = 0;i < photoList.Count;i++)
{
Console.WriteLine("albumName is " + album.GetName());
Console.WriteLine("albumDescription is " + album.GetDescription());
}	
String 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"
                        }
                    }
                }
            }
        }
    }
}
public void AddTagToPhoto(String userName, String albumName, String photoName, IList tagList, App42Callback requestCallback)

Adds tag to the Photo of the user in the album.

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 tages in Photo
requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

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
String userName = "Nick";
String albumName = "MyAlbum";
String photoName = "PhotoName_01";

ArrayList<String> tagList = new ArrayList<String>();					
tagList.add("John");
photoService.AddTagToPhoto(userName,albumName,photoName,taglist,requestCallback);  /* returns the Album object. */ 
OnSuccess(Object obj)
{
Album album = (Album) obj;
String albumName = album.GetName();
String albumDescription = album.GetDescription();
IList<Album.Photo> photoList = album.GetPhotoList();
for(int i = 0;i < photoList.Count;i++)
{
Console.WriteLine("albumName is " + photoList[i].GetName());
Console.WriteLine("albumDescription is " + photoList[i].GetDescription());		
Console.WriteLine("albumDescription is " + photoList[i].GetTagList());		
}	
String 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"
                        }
                    }
                }
            }
        }
    }
}
public void GetPhotos(String userName, App42Callback requestCallback)

Fetch all the Photos based on the userName.

Parameters:

userName - Name of the User whose photos have to be fetched
requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

Returns:

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

Response: IList<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
String userName = "Nick";
						
IList<Album> albumList = photoService.GetPhotos(userName,requestCallback); /* returns the list of Album objects. */
OnSuccess(Object obj)
{
IList<Album> albumList = (IList<Album>) obj;
for(int i = 0;i < albumList.Count;i++)
{
Console.WriteLine("userName is " + albumList[i].GetUserName());
Console.WriteLine("albumName is " +albumList[i].GetName());
Console.WriteLine("albumDescription is " +albumList[i].GetDescription());
IList<Album.Photo> photoList = albumList[i].GetPhotoList();
for(int j = 0;j < photoList.Count;j++)
{
Console.WriteLine("name is " + photoList[j].GetName());
Console.WriteLine("description is " +photoList[j].GetDescription());
}	
}
String 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"
                    }
                ]
            }
        }
    }
}
public void GetTaggedPhotos(String userName, String tag, App42Callback requestCallback)

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
requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

Returns:

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

Response: IList<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
String userName = "Nick";
String tag = "joy";

photoService.GetTaggedPhotos(userName,tag,requestCallback); /* returns the list of Album objects. */
OnSuccess(Object obj)
{
IList<Album> albumList = (IList<Album>) obj;
for(int i = 0;i < albumList.Count;i++)
{
Console.WriteLine("userName is " + albumList[i].GetUserName());
Console.WriteLine("albumName is " +albumList[i].GetName());
Console.WriteLine("albumDescription is " +albumList[i].GetDescription());
IList<Album.Photo> photoList = albumList[i].GetPhotoList();
for(int j = 0;j < photoList.Count;j++)
{
Console.WriteLine("name is " + photoList[j].GetName());
Console.WriteLine("description is " +photoList[j].GetDescription());	
}
}
String 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"
                        }
                    }
                }
            }
        }
    }
}
public void GetPhotosByAlbumName(String userName, String albumName, App42Callback requestCallback)

Fetch all Photos based on the userName and album name

Parameters:

userName - Name of the User whose photos have to be fetched
requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.
albumName - Name of the Album from which photos have to be fetched
requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

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
String userName = "Nick";
String albumName = "MyAlbum";

photoService.GetPhotosByAlbumName(userName,albumName,requestCallback);  /* returns the Album object. */ 
OnSuccess(Object obj){
Album album = (Album) obj;
String albumName =  album.GetName(); 
String userName =  album.GetUserName(); 
String albumDescription = album.GetDescription(); 
IList<Album.Photo> photoList = album.GetPhotoList();
for(int i = 0;i < photoList.Count;i++)
{
Album.Photo photo = photoList[i].Get[i];
String name = photoList[i].GetName();
String description = photoList[i].GetDescription();
String url = photoList[i].GetUrl();
String thumbNailUrl = photoList[i].GetThumbNailUrl();
}
String 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"
                            }
                        ]
                    }
                }
            }
        }
    }
}
public void GetPhotosCountByAlbumName(String userName, String albumName, App42Callback requestCallback)

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
requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

Returns:

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

Response: App42Response Object

For more details click Exception
String userName = "Nick";
String albumName = "MyAlbum";	

photoService.GetPhotosCountByAlbumName(userName,albumName,requestCallback);  /* returns the App42Respnse object. */ 
OnSuccess(Object obj){
App42Response response = (App42Response) obj;
Boolean success = response.IsResponseSuccess();
int totalRecords = response.GetTotalRecords();
String jsonResponse = response.ToString(); /* returns the response in JSON format. (as shown below)*/
}
                            
{
   "app42": {
       "response": {
           "success": true,
           "totalRecords": 3
       }
   }
}
public void GetPhotosByAlbumName(String userName, String albumName, int max, int offset, App42Callback requestCallback)

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
requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

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
String userName = "Nick";
String albumName = "MyAlbum";
int max = 1;
int offset = 0;

albumService.GetPhotosByAlbumName(userName,albumName,max,offset,requestCallback);  /* returns the Album object. */ 
OnSuccess(Object obj){
Album album =(Album) obj;
String albumName =  album.GetName(); 
String userName =  album.GetUserName(); 
String albumDescription = album.GetDescription(); 
IList<Photo> photoList = album.GetPhotoList();
for(int j=0;j < photoList.Count;j++)
{
Console.WriteLine("albumName is " +photoList[i].GetName());
Console.WriteLine("albumDescription is " +photoList[i].GetDescription());
}
String 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"
                       }
                   }
               }
           }
       }
   }
}
public Album GetPhotosByAlbumAndPhotoName(String userName, String albumName, String photoName, App42Callback requestCallback)

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
requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

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
String userName = "Nick";
String albumName = "MyAlbum";
String photoName = "Photo091";

photoService.GetPhotosByAlbumAndPhotoName(userName,albumName,photoName,requestCallback);  /* returns the Album object. */ 
OnSuccess(Object obj)
{
Album album = (Album) obj;
String albumName = album.GetName();
String albumDescription = album.GetDescription();
IList<Album.Photo> photoList = album.GetPhotoList();
for(int i= 0;i < photoList.Count;i++)
{
Console.WriteLine("albumName is " +photoList[i].GetName());
Console.WriteLine("albumDescription is " +photoList[i].GetDescription());	
}	
String 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"
                        }
                    }
                }
            }
        }
    }
}
public void RemovePhoto(String userName, String albumName, String photoName, App42Callback requestCallback)

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
requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

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
photoService.RemovePhoto(userName, albumName, photoName,requestCallback); /* returns the App42Response object. */

OnSuccess(Object obj)
{
App42Response response = (App42Response) obj;
Boolean success = response.IsResponseSuccess();
String 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"
                        }
                    }
                }
            }
        }
    }
}