Introduction
The MyDailyPhoto API allows developers to access and retrieve information about users and the community to integrate into their own applications. This is accomplished by verifying the authenticity of the developer, receiving a request from the developer's application, and returning the requested information in a specified format.
Supported Formats
API Wrappers
We're constantly working on making integration with the MyDailyPhoto API easier by developing API wrappers for popular languages. Below you can find a list of wrappers currently available:
PHP API Wrapper
URL Request Structure
All API calls must be sent to the following URL:
https://mydailyphoto.com/api/
Each parameter should be appended to the API request URL. Every request must include with an application API authorization key. For example:
https://mydailyphoto.com/api/?key=[API_KEY]&command=[COMMAND]&[PARAMETERS]
or
https://mydailyphoto.com/api/?key=123ABC&command=getUser&username=testUser
Application Authentication
To begin integrating MyDailyPhoto data into your application you will need to obtain an API authorization key ("API Key").
User Privacy & Authentication
In order to access information about a user they must allow API access and have a public profile (which is set on registration and can be changed from the "Settings" page). Any information marked as "Private" or "Friends Only" is not available through the API without an authorization token.
To send information (Write API), or retrieve private data, the user must first grant an application access to their account. This can be accomplished by prompting a user for their username and password and sending a "getAuthorization" API request with the submitted username and password through Basic Access Authentication.
For example:
https://username:password@mydailyphoto.com/api/?key=[API_KEY]&command=getAuthorization
You will be returned an authentication token that should be sent with all necessary future requests. For example:
https://mydailyphoto.com/api/?key=[API_KEY]&command=getMessages&token=[USER_TOKEN]
Error Codes
-
000
Insecure Request
The request was not sent over a secure connection
-
001
Invalid API key
The application authentication key is not valid
-
002
Application not yet approved
The application has not yet been approved for API use
-
003
Invalid method requested
The requested API method does not exist
-
004
Improper authorization method
You must use Basic Access Authentication for this method
-
005
Failed to authenticate user
The user token provided is not valid
-
010
User does not exist
The requested user does not exist
-
011
Invalid authorization
The user authentication key is not valid
-
012
User data not accessible
The requested user does not allow API access
-
013
User data is private
The requested user information is set as private
-
020
Photo date not set
No date was set for the photo request
-
021
Photo data is private
The requested photo information is set as private
-
030
No search term provided
You must provide a search term
getAuthorization
Retrieve the token for a user, allowing authenticated future requests.
Authentication
-
Required
(Basic Access Authentication)
Return
-
token
string
The token to be used with future authenticated requests
getCommentsPhoto
getCommentsUser
getFriends
Retrieve a list of a user's friends.
Authentication
Parameters
-
username
string
The user's username
Return
-
friends
array
An array of user arrays (see "getUser" documentation for available values)
getMessages
Retrieve all notices for a user.
Authentication
Parameters
-
page
integer
The page number to return (default: 0)
-
page_size
integer
The number of notices to return per page (default: 10, max: 50)
Return
-
id
array
The ID of the message
-
timestamp
integer
The timestamp of when the notice was posted
-
time
string
The formatted, localized time of when the notice was posted
-
type
integer
The type of notice (1: friend request, 2: user comment, 3: photo comment, 4: contest winner)
-
status
integer
The status of the notice (0: unread, 1: read)
-
text
string
The text associated with the notice
-
sender
array
-
id
integer
The GUID of the user
-
username
string
The current username for the user
-
name
string
The user's first name
-
photo
array
-
id
integer
The GUID of the photo
-
timestamp
integer
The timestamp of when the photo was submitted
-
time
string
The formatted, localized time of when the photo was submitted
-
contest
array
-
id
integer
The GUID of the user
-
name
string
The display name of the contest
getMissedDates
Retrieve dates a user hasn't posted a photo for.
Authentication
Parameters
-
username
string
The user's username
Return
-
date
int
The date of the photo (format: YYYYMMDD)
-
date_formatted
string
The formatted date of the photo
getPhoto
Retrieve a specific photo.
Authentication
Parameters
-
username
string
The user's username
-
date
integer
The date of the photo to retrieve (format: YYYYMMDD)
Return
-
caption
string
The caption for the photo
-
date
integer
The date the photo was submitted for (format: YYYYMMDD)
-
description
text
The description for the photo
-
exif
array
A key-value pair of EXIF data (key: EXIF data type, value: EXIF value)
-
id
integer
The GUID of the photo
-
link
string
The URL to the photo detail page
-
rating
integer
The current rating of the photo
-
rating_total
integer
The sum of all ratings submitted
-
rating_votes
integer
The number of ratings submitted
-
src_xl
string
A link to the very large variant of the photo (if available)
-
src_l
string
A link to the large variant of the photo
-
src_m
string
A link to the medium variant of the photo (250 x 167px)
-
src_s
string
A link to the small variant of the photo (100 x 67px)
-
tags
array
An array of all associated tags
-
timestamp
integer
The timestamp of when the photo was submitted
getPhotos
Retrieve photos within a given range for a specific user.
Authentication
Parameters
-
username
string
The user's username
-
start_date
integer
The start of the date range (format: YYYYMMDD, or YYYYMM for full month)
-
end_date
integer
The end of the date range (default: last day of month or current date)
Return
-
photos
array
A date-keyed array of photo arrays (see "getPhoto" documentation for available values)
getSearch
Retrieve user and photo search results for a query term.
Authentication
Parameters
-
term
string
The term to search for
Return
-
users
array
Users that match the query term
-
id
integer
The GUID of the user
-
username
string
The current username for the user
-
avatar
string
A link to the user's avatar
-
link
string
The URL to the user's profile
-
user_photos
array
Photos by the authenticated user that match the query term
-
caption
string
The caption for the photo
-
date
integer
The date the photo was submitted for (format: YYYYMMDD)
-
id
integer
The GUID of the photo
-
link
string
The URL to the photo detail page
-
src_s
string
A link to the small variant of the photo (100 x 67px)
-
timestamp
integer
The timestamp of when the photo was submitted
-
username
string
The username for the user who submitted the photo
-
photos
array
Photos that match the query term
-
caption
string
The caption for the photo
-
date
integer
The date the photo was submitted for (format: YYYYMMDD)
-
id
integer
The GUID of the photo
-
link
string
The URL to the photo detail page
-
src_s
string
A link to the small variant of the photo (100 x 67px)
-
timestamp
integer
The timestamp of when the photo was submitted
-
username
string
The username for the user who submitted the photo
getUser
Retrieve all available information about a specific user.
Authentication
Parameters
-
username
string
The user to retrieve information for
Return
-
id
integer
The GUID of the user
-
username
string
The current username for the user
-
is_active
integer
Whether or not the user is considered active (0: False, 1: True)
-
is_pro
integer
Whether or not the user has a premium account (0: False, 1: True)
-
avatar
string
A link to the user's avatar
-
bio_about
array
-
interests
text
The user's listed interests
-
camera
text
The user's listed camera gear
-
bio_excuse
string
The current excuse of the user
-
bio_messenger
array
A key-value pair of instant messenger IDs (key: service, value: ID)
-
bio_website
string
The URL of the user's website
-
bio_website_text
string
The abbreviated URL of the user's website
-
days_missed
integer
The number of days the user didn't post
-
days_passed
integer
The number of days since the user joined
-
days_percent
integer
The percentage a user has posted
-
days_posted
integer
The number of day the user did post
-
friends
array
A key-value pair of friends (key: friend ID, value: approval status)
-
join_date
integer
The date the user joined (format: YYYYMMDD)
-
join_reason_text
string
The reason the user registered
-
join_years
integer
The number of years a user has been a member
-
link
string
The URL to the user's profile
-
loc_country
string
The user's country
-
loc_city
string
The user's city
-
loc_state
string
The user's state
-
loc_timezone
string
The user's timezone
-
location
string
The user's full location
-
name_first
string
The user's first name
-
name_last
string
The user's last name
-
name_full
string
The user's full name
-
notices
integer
The number of unread notices for the user
-
photo
string
A link to the user's photo
setCommentPhoto
setCommentUser
setExcuse
Set a user's excuse.
Authentication
Parameters
-
excuse
string
The user's excuse.
setFriend
Manage a user's friendship with another user.
Authentication
Parameters
-
friend_id
integer
The GUID of the friend to manage
-
status
integer
The new status of the friendship (0: add, 1: approve, 2: delete / deny)
setPhoto
Upload a photo to a user's account.
Authentication
Parameters
-
date
integer
The date the photo was taken (format: YYYYMMDD)
-
caption
string
The caption for the photo
-
description
text
The description for the photo
-
tags
string
A comma-separated list of tags
-
privacy
integer
The privacy level to set for the photo (0: public, 1: friends only, 2: private)
-
share
integer
Whether to socially share the photo, e.g. Twitter (0: no, 1: yes)
Return
-
id
integer
The GUID of the photo
-
link
string
The URL to the photo detail page
-
src_xl
string
A link to the very large variant of the photo (if available)
-
src_l
string
A link to the large variant of the photo
-
src_m
string
A link to the medium variant of the photo (250 x 167px)
-
src_s
string
A link to the small variant of the photo (100 x 67px)
#
Authentication
Parameters
Return