Flickr Connector

This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Flickr Connector

The Flickr connector allows you to connect to Flickr, which is an online photo management and sharing application. The connector uses the Flickr REST API to connect to Flickr and work with photos, people and more. ESB Templates and call mediator are used to send the requests to the Flickr REST endpoints. Underlying java classes help with the OAuth and signing process.

The following sections describe how to perform various operations with the connector. For general information on using connectors and their operations in your ESB configurations, see Using a Connector. To download the connector, go to https://store.wso2.com/store/assets/esbconnector/flickr, and click Download Connector. Then you can add and enable the connector in your ESB instance.


Connecting to Flickr

To use the Flickr connector, add the <flickr.init> element in your configuration before any other Flickr operations. This will keep the the information such as the API key, access token, and secrets to be used in the subsequent flickr operations.

init
<flickr.init> <consumerKey>00a49886c96cd978d1c513cb2d33742b</consumerKey> <consumerKeySecret>f20cca596738e959</consumerKeySecret> <accessToken>72157642842074863-5faf0186518885ab</accessToken> <accessTokenSecret>70cd37fb502cb6fd</accessTokenSecret> </flickr.init>
Entering secure data

For security purposes, you should store your SID and token in the WSO2 secure vault and reference it by an alias instead of hard-coding the actual values in the configuration file. For more information, see Working with Passwords.

Re-using Flickr configurations

For best results, save the Flickr configuration as a local entry. You can then easily reference it with the configKey attribute in your Flickr operations. For example, if you saved the above <flickr.init> entry as a local entry named MyFlickrConfig, you could reference it from an operation like getInfo as follows:

getInfo
<flickr.getInfo configKey="MyFlickrConfig"> <userId>121275475@N06</userId> <format>json</format> </flickr.getInfo>

Working with people

The following operations are available for working with people:

Operation

Description

Operation

Description

getInfo

Gets the information about a user.

getPhotos

Returns photos from the given user's photostream. Only photos visible to the calling user will be returned.

Getting information of a user 

getInfo
<flickr.getInfo> <userId>121275475@N06</userId> </flickr.getInfo>

This will return the information about the user . Use this operation with the following properties.

Properties
  • userId: The ID of the user whose information needs to be retrieved.

Related Flickr documentation

https://www.flickr.com/services/api/flickr.people.getPhotos.html

Getting a list of photos belonging to a user 

getPhotos
<flickr.getPhotos> <userId>121275475@N06</userId> <minUploadDate>1356998400</minUploadDate> <maxUploadDate>1420070400</maxUploadDate> <minTakenDate>1356998400</minTakenDate> <maxTakenDate>1420070400</maxTakenDate> <extras>license</extras> </flickr.getPhotos>

This operation will get the list of photos that belongs to the specified user . Following parameters can be used with the operation. Note that userId is the only mandatory parameter.

Properties
  • userId: The ID of the user whose photos needs to be retrieved.

  • minUploadDate: The minimum upload date. This is an optional parameter. Photos which were uploaded later or on the same date will be returned. The date should be in the form of a unix timestamp.

  • maxUploadDate : The maximum upload date. This is an optional parameter. Photos which were uploaded earlier or on the same date will be returned. The date should be in the form of a unix timestamp.

  • minTakenDate: The minimum taken date. This is an optional parameter. Photos which were taken later or on the same date will be returned. The date should be in the form of a mysql datetime.

  • maxTakenDate: The maximum taken date. This is an optional parameter. Photos which were taken earlier or on the same date will be returned. The date should be in the form of a mysql datetime.

  • extras: A comma-delimited list of extra information to fetch for each returned record. This is an optional parameter. Currently supported fields are:  description license , date_upload date_taken owner_name icon_server original_format last_update geo tags machine_tags o_dims views , media path_alias url_sq url_t url_s url_q url_m url_n url_z url_c url_l url_o

Related Flickr documentation

https://www.flickr.com/services/api/flickr.people.getPhotos.html


Working with photos

The following operations are available for working with photos:

Operation

Description

Operation

Description

getPhotoInfo

Gets the information about a photo.The calling user should have permission to view the photo.

getExif

Retrieves a list of EXIF/TIFF/GPS tags for a given photo. The calling user should have permission to view the photo.

addTags

Adds tags to a photo.

removeTag

Removes a tag from a photo.

deletePhoto

Deletes a photo from flickr.

Getting information of a photo 

getPhotoInfo
<flickr.getPhotoInfo> <photoId>13376045033</photoId> </flickr.getPhotoInfo>

This will return the information about the photo. Use this operation with the following properties.

Properties
  • photoId: The ID of the photo to retrieve information.

Related Flickr documentation