MySpace Developer Platform

A Place For Developers

Welcome Developers!

Welcome!

Resources

Resources in a REST software architecture are defined as specific sources of information, and are referenced by the global identifier URIs associated with them.

A representation of a resource is a file that contains the parameters that precisely define the resource. For example, the representation of a circle may be represented as a center point and a radius. The clients and servers on a network communicate through a standard interface such as HTTP to exchange representations of the resources.

For an application to communicate with a resource, the application needs the identifier of the resource (the URI), the action required - such as GET -, and the format of the representation. This format may be any type of content, but is typically an HTML or XML  document. The application communicating with a resource does not need information concerning firewalls, gateways, proxies or other network devices between the application and the server holding the resource.

Albums:

RESOURCE: /v1/users/{userid}/albums
DESCRIPTION: Returns albums of the user specified by userid
REST FORMAT: /v1/users/{userid}/albums
REQUEST METHOD: GET
PARAMETERS: URI: userid

 

RESOURCE: /v1/users/{userid}/albums/{albumid}
DESCRIPTION: Retrieves the album information specified by albumid for the user specified by userid.
REST FORMAT: /v1/users/{userid}/albums/{albumid}
REQUEST METHOD: GET
PARAMETERS: URI: userid, albumid

App data:

RESOURCE: /v1/users/{userid}/appdata
DESCRIPTION: Returns the key/value combinations representing the app data assigned to the user specified by userid.
REST FORMAT:  
REQUEST METHOD: GET
PARAMETERS: URI: userid

 

RESOURCE: /v1/users/{userid}/appdata
DESCRIPTION: Creates key/value combinations representing the app data for the user specified by userid.
REST FORMAT: /v1/users/{userid}/appdata
REQUEST METHOD: PUT
PARAMETERS: URI: userid
URL-encoded form parameters representing arbitrary key/value pairs separated by a semicolon (key1=val1&key2=val2)
RESPONSE: No XML response is sent back

 

RESOURCE: /v1/users/{userid}/appdata/{keys}
DESCRIPTION: Returns the key/value combinations representing the app data assigned to the user specified by userid for the keys specified by the semicolon-delimited list parameter keys.
REST FORMAT: /v1/users/{userid}/appdata/{keys}
REQUEST METHOD: GET
PARAMETERS: URI: userid
keys – list of keys separated by semicolon

 

RESOURCE: /v1/users/{userid}/friends/appdata
DESCRIPTION: Returns the key/value combinations representing the app data assigned to the friends of the user specified by userid.
REST FORMAT: /v1/users/{userid}/ friends/appdata
REQUEST METHOD: GET
PARAMETERS: URI: userid

 

RESOURCE: /v1/users/{userid}/friends/appdata/{keys}
DESCRIPTION: Returns the key/value combinations representing the app data assigned to the friends of the user specified by userid for the keys specified by the semicolon-delimited list parameter keys.
REST FORMAT: /v1/users/{userid}/friends /appdata/{keys}
REQUEST METHOD: GET
PARAMETERS: URI: userid
keys – list of keys separated by semicolon

 

 

 

Friends:

RESOURCE: /v1/users/{userid}/friends?[list=top|online|app][&page=N][&page_size=M|all][& show=mood|status|online]
DESCRIPTION: Retrieves the list of friends of the user identified by the parameter userid. All parameters are optional.

Parameter page specifies the sequential page number starting from 1 and parameter Parameter page_size specifies the number of friends per page. Here N and M are integers. If the page parameter is not specified, the returned list of resources will start from the first page. page_size defaults to 20 if not specified. If page_size is set to all all resources in the requested list will be returned.

Parameter list may contain one of the following values :
top – top friends will be returned; online – online friends list will be retrieved; or app – the friends who have installed user’s application will be returned. If omitted – all resources will be returned.

Parameter show may have any combination of the following values separated by a vertical pipe character: mood - the resources will indicate the mood of the friend; status - the resources will indicate the status of the friend; online - the resources will indicate the online status of the friend.
REQUEST METHOD: GET
PARAMETERS: URI: userid, [list], [page], [page_size], [show]


RESOURCE: /v1/users/{userid}/friendslist/{friendid}show=mood|status|online]
DESCRIPTION:

Retrieves the basic friend’s information specified by {friendid} of the user {userId}

Parameter show may have any combination of the following values separated by a vertical pipe character: mood - the resources will indicate the mood of the friend; status - the resources will indicate the status of the friend; online - the resources will indicate the online status of the friend.

REQUEST METHOD: GET
PARAMETERS: URI: [show]


RESOURCE: /v1/users/{userid}/friendslist/{friend1; friend2; friend3….}?[show=mood|status|online]
DESCRIPTION:

Retrieves the list of friends specified by semicolon separated list of the user {userId}

Parameter show may have any combination of the following values separated by a vertical pipe character: mood - the resources will indicate the mood of the friend; status - the resources will indicate the status of the friend; online - the resources will indicate the online status of the friend.

REQUEST METHOD: GET
PARAMETERS: URI: [show]

 

RESOURCE: v1/users/{userID}/friends/Status? Page_size=10
DESCRIPTION: Retrieves mood and status of friends in order of descending lastupdated time. This  takes optional parameters  page and page_size
REST FORMAT: v1/users/{userID}/friends/Status? Page_size=10
REQUEST METHOD: GET
PARAMETERS: URI: userId [page], [page_size]
OPENSOCIAL EQUIVALENTS: None
EXAMPLE: http://api.myspace.com/v1/users/26000814/friends/status?page_size=4
RESULTS:
<friends  count="1">
<user>
<<userid>6221</userid> >
<uri>http://local-api.myspace.com/v1/users/6221</uri>
<mood>chipper</mood>
<moodimageurl> http://x.myspace.com/images/blog/moods/iBrads/chipper.gif
</moodimageurl >
<moodlastupdated> 4/21/2008 10:17:50 AM</moodlastupdated>
<status > is watching raging bull and just posted a blog.. read it!</</status>
</user>
</friends>

Friendship:

RESOURCE: /v1/users/{userid}/friends/{friendsid}
DESCRIPTION: Indicates whether the user specified by {friendsid} is a friend of the user
REQUEST METHOD: GET
PARAMETERS: URI: userid, friendsid
friendsid is a semicolon-delimited list of friend ids

Global:

RESOURCE: /v1/appdata/global
DESCRIPTION: Gets all global appdata
REST FORMAT: /v1/appdata/global
REQUEST METHOD: PUT
PARAMETERS: URL-encoded form parameters representing arbitrary key/value pairs separated by a semicolon (key1=val1&key2=val2)
RESPONSE: No XML response is sent back.

 

RESOURCE: /v1/appdata/global/{keys}
DESCRIPTION: Gets all global appdata for specified list of keys
REST FORMAT:  
REQUEST METHOD: GET
PARAMETERS: URI: keys – list of keys separated by semicolon

Indicators:

RESOURCE: /v1/users/{userid}/indicators
DESCRIPTION: Returns indicators Url for those indicators which are true , for false it suppress tags
REST FORMAT: /v1/users/{userid}/indicators
REQUEST METHOD: GET
PARAMETERS: URI: userid
OPENSOCIAL EQUIVALENT: None
EXAMPLE: http://api.myspace.com/v1/user/26000010/indicators
RESULTS:
<indicators>
     <mailurl>..</mailurl>
     <birthdayurl>..</birthdayurl>
     <blogcommenturl>..</blogcommenturl>
     <blogsubscriptionposturl>..</blogsubscriptionposturl>
     <commenturl>..</commenturl>
     <eventinvitationurl>..</eventinvitationurl>
     <friendrequesturl>../friendrequesturl>
     <groupnotificationurl>..</groupnotificationurl>
     <phototagapprovalurl>..</phototagapprovalurl>
     <picturecommenturl>..</picturecommenturl>
     <recentlyaddedfriendurl>..</recentlyaddedfriendurl>
     <videocommenturl>..</videocommenturl>
     <videoprocessurl>..</videoprocessurl>
</indicators>

Mood:

RESOURCE: /v1/users/{userid}/mood
DESCRIPTION: Returns mood information for the user referenced by userid
REST FORMAT: /v1/users/{userid}/mood
REQUEST METHOD: GET
PARAMETERS: URI: userid

 

RESOURCE: /v1/users/{userid}/mood
DESCRIPTION: Uploads the mood for the user referenced by userid
REST FORMAT: /v1/users/{userid}/mood
REQUEST METHOD: PUT
PARAMETERS: URI: userid
URL-encoded form data: mood – integer value
Possible values for parameter mood: ???

Photos:

RESOURCE: /v1/users/{userid}/photos
DESCRIPTION: Returns all photos of the user specified by userid
REST FORMAT: /v1/users/{userid}/photos
REQUEST METHOD: GET
PARAMETERS: URI: userid

 

RESOURCE: /v1/users/{userid}/albums/{albumid}/photos
DESCRIPTION: Returns the photo specified by photoid belonging to the user specified by userid
REST FORMAT:  
REQUEST METHOD: GET
PARAMETERS: URI: userid, photoid

 

RESOURCE: /v1/users/{userid}/albums/{albumid}/photos/{photoid}
DESCRIPTION: Returns the photo specified by photoid from the album specified by albumid and belonging to the user specified by userid
REST FORMAT: /v1/users/{userid}/albums/{albumid}/photos/{photoid}
REQUEST METHOD: GET
PARAMETERS: URI: userid, photoid

 

Profile:

RESOURCE: /v1/users/{userid}/profile
DESCRIPTION: Retrieves the full profile information for specific user identified by parameter userid
REQUEST METHOD: GET
PARAMETERS: URI: userid
RESPONSE: Returns information for the user identified by parameter userid

Status:

RESOURCE: /v1/users/{userid}/status
DESCRIPTION: Returns status information for the user referenced by userid
REST FORMAT: /v1/users/{userid}/status
REQUEST METHOD: GET
PARAMETERS: URI: userid

 

RESOURCE: /v1/users/{userid}/status
DESCRIPTION: Uploads the status for the user referenced by userid
REST FORMAT: /v1/users/{userid}/status
REQUEST METHOD: PUT
PARAMETERS: URI: userid
URL-encoded form data: status – text value

User:

RESOURCE: /v1/user
DESCRIPTION: Returns information about the user in session based authentication scenarios. This request must include the oauth_token parameter with an access token.
REQUEST METHOD: GET
PARAMETERS: NONE

Users:

RESOURCE: /v1/users/{userid}
DESCRIPTION: Retrieves information for specific user identified by parameter userid
REQUEST METHOD: GET
PARAMETERS: URI: userid
RESPONSE: Returns information for the user identified by parameter userid

Videos:

RESOURCE: /v1/users/{userid}/videos
DESCRIPTION: Returns the videos of the user specified by userid.
REST FORMAT: /v1/users/{userid}/videos
REQUEST METHOD: GET
PARAMETERS: URI: userid

 

RESOURCE: /v1/users/{userid}/videos/{videoid}
DESCRIPTION: Returns the video specified by videoid belonging to the user specified by userid.
REST FORMAT: /v1/users/{userid}/videos/{videoid}
REQUEST METHOD: GET
PARAMETERS: URI: userid, videoid