You must provide proper attribution for any Creative Commons works that you choose to use. All CC attributions should have the same basic information:
Required Citation Information:
Title: Shaker Buildings
Creator: Rick Payette
Source: Flickr (https://www.flickr.com/photos/catzrule/21632635463/)
Copyright License: CC Attribution-NonCommercial-NoDerivs 2.0 Generic (CC BY-NC-SA 2.0)
In an online environment, hyperlinks can be used to shorten the citation. In a print resource, the citation will be longer as all of the required information must be written out in full. Both citations are correct, as they both provide the necessary information.
Short attribution statement with hyperlinks:
"Shaker Buildings" by Rick Payette (CC BY-NC-SA 2.0)
Full attribution statement without hyperlinks:
"Shaker Buildings" by Rick Payette, retrieved from https:www.flickr.com/photos/catzrule/21632635463/, used under Creative Commons Attribution-NonCommercial-NoDerivs 2.0 Generic license (http://creativecommons.org/licenses/by-nc-nd/2.0/).
For more examples of proper attributions, see:
Best Practices for Attribution (Creative Commons Wiki)