MySpace Developer Platform

A Place For Developers
From MySpace Open Platform: Documentation Wiki

OpenSocial Version 0.8 Breaking Changes

Jump to: navigation, search
Content > Documentation > Articles
Featured

Contents

Enumerations String values

The case of some of the enumeration values has changed. To avoid conflicts, use the enumeration instead of string values.

Example:

var preferredPersonId = opensocial.IdSpec.PersonId.VIEWER;    //This is the preferred way.
var incorrectPersonId = "VIEWER" //This may not work.

IdSpec

The definition of IdSpec changed from:

"An ID, array of IDs, or a group reference; the supported keys are VIEWER, OWNER, VIEWER_FRIENDS, OWNER_FRIENDS, or a single ID within one of those groups"

To:

An object of type opensocial.IdSpec.

MySpace allows the following combination of values:

IdSpec Type opensocial.IdSpec.Field Values

Viewer

USER_ID:

opensocial.IdSpec.PersonId.VIEWER

NETWORK_DISTANCE:

0

GROUP_ID:

[anything]

 

USER_ID:

opensocial.IdSpec.PersonId.VIEWER

NETWORK_DISTANCE:

undefined

GROUP_ID:

undefined

 

USER_ID:

opensocial.IdSpec.PersonId.VIEWER

NETWORK_DISTANCE:

undefined

GROUP_ID:

opensocial.IdSpec.GroupId.SELF

 

Owner

USER_ID:

opensocial.IdSpec.PersonId.OWNER

NETWORK_DISTANCE:

0

GROUP_ID:

[anything]

 

USER_ID:

opensocial.IdSpec.PersonId.OWNER

NETWORK_DISTANCE:

undefined

GROUP_ID:

undefined

 

USER_ID:

opensocial.IdSpec.PersonId.OWNER

NETWORK_DISTANCE:

undefined

GROUP_ID:

opensocial.IdSpec.GroupId.SELF

 

Viewer Friends

USER_ID:

opensocial.IdSpec.PersonId.VIEWER

NETWORK_DISTANCE:

1

GROUP_ID:

[anything]

 

USER_ID:

opensocial.IdSpec.PersonId.VIEWER

NETWORK_DISTANCE:

undefined

GROUP_ID:

opensocial.IdSpec.GroupId .FRIENDS

 

Owner Friends

USER_ID:

opensocial.IdSpec.PersonId.OWNER

NETWORK_DISTANCE:

1

GROUP_ID:

[anything]

 

USER_ID:

opensocial.IdSpec.PersonId.OWNER

NETWORK_DISTANCE:

undefined

GROUP_ID:

opensocial.IdSpec.GroupId .FRIENDS

 

ID

USER_ID:

user id
(e.g. "4568654" or "myspace.com: 4568654")

NETWORK_DISTANCE:

0

GROUP_ID:

[anything]

 

USER_ID:

user id
(e.g. "4568654" or "myspace.com: 4568654")

NETWORK_DISTANCE:

undefined

GROUP_ID:

opensocial.IdSpec.GroupId .SELF

 

Arrays of IDs

USER_ID:

Array of user ids.
(e.g. ["4568654", "5898456"]
or ["myspace.com: 4568654", "5898456"])

NETWORK_DISTANCE:

0

GROUP_ID:

[anything]

 

USER_ID:

Array of user ids.
(e.g. ["4568654", "5898456"]
or ["myspace.com: 4568654", "5898456"])

NETWORK_DISTANCE:

undefined

GROUP_ID:

opensocial.IdSpec.GroupId .SELF


Note: even though MySpace supports these idSpecs, the particular request may not support them.

The following table shows the allowed type of idSpecs by request type:

Request Supported idSpec type

newFetchActivitiesRequest

VIEWER
OWNER
VIEWER FRIENDS
OWNER FRIENDS

newFetchPeopleRequest

VIEWER FRIENDS
OWNER FRIENDS
ID

newFetchPersonAppDataRequest

VIEWER
OWNER
VIEWER FRIENDS
OWNER FRIENDS

Person

Person now supports the standard fields and MySpace extensions in the table below. Note: the return type of some fields may have changed. Any attempt to retrieve a field outside this list will result in a not implemented error.

Field

Return Type

opensocial.Person.Field.ABOUT_ME

String

opensocial.Person.Field.AGE

Number

opensocial.Person.Field.BODY_TYPE

opensocial.BodyType

opensocial.Person.Field.BOOKS

Array of strings

This will return an Array of strings with only one element.

opensocial.Person.Field.CHILDREN

String

opensocial.Person.Field.CURRENT_LOCATION

opensocial.Address

Returned fields:
opensocial.Address.Field.REGION
opensocial.Address.Field.POSTAL_CODE
opensocial.Address.Field.COUNTRY

opensocial.Person.Field.DATE_OF_BIRTH

Date

opensocial.Person.Field.DRINKER

opensocial.Enum

opensocial.Person.Field.ETHNICITY

String

opensocial.Person.Field.GENDER

opensocial.Enum

opensocial.Person.Field.HAS_APP

Boolean

opensocial.Person.Field.HEROES

Array of strings

This will return an Array of strings with only one element.

opensocial.Person.Field.ID

String
myspace.com:111111

opensocial.Person.Field.INTERESTS

Array of strings

This will return an Array of strings with only one element.

opensocial.Person.Field.JOBS

Array of opensocial.Organization

Returned fields:
opensocial.Organization.Field.NAME
opensocial.Organization.Field.TITLE

opensocial.Person.Field.LOOKING_FOR

opensocial.Enum
Just getDisplayValue() is set, getKey() will return always null

opensocial.Person.Field.MOVIES

Array of strings

This will return an Array of strings with only one element.

opensocial.Person.Field.MUSIC

Array of strings

This will return an Array of strings with only one element.

opensocial.Person.Field.NAME

opensocial.Name

Returned fields:
opensocial.Name.Field.UNSTRUCTURED
opensocial.Name.Field.GIVEN_NAME
opensocial.Name.Field.FAMILY_NAME

This may not be present depending on user preferences.

opensocial.Person.Field.NETWORK_PRESENCE

opensocial.Enum

opensocial.Person.Field.NICKNAME

String

opensocial.Person.Field.PROFILE_SONG

opensocial.Url

Returned fields:
opensocial.Url.Field.LINK_TEXT

opensocial.Person.Field.PROFILE_URL

String

opensocial.Person.Field.RELATIONSHIP_STATUS

String

opensocial.Person.Field.RELIGION

String

opensocial.Person.Field.SEXUAL_ORIENTATION

String

opensocial.Person.Field.SMOKER

opensocial.Enum

opensocial.Person.Field.STATUS

String

opensocial.Person.Field.THUMBNAIL_URL

String

opensocial.Person.Field.TV_SHOWS

Array of strings

This will return an Array of strings with only one element.

opensocial.Person.Field.URLS

Array of opensocial.Url

Returned fields:
opensocial.Url.Field.ADDRESS
opensocial.Url.Field.TYPE

MyOpenSpace.Person.Field.MEDIUM_IMAGE

Array of opensocial.Url

Returned fields:
opensocial.Url.Field.ADDRESS
opensocial.Url.Field.TYPE

MyOpenSpace.Person.Field. LARGE_IMAGE

Array of opensocial.Url

Returned fields:
opensocial.Url.Field.ADDRESS
opensocial.Url.Field.TYPE

newFetchPeopleRequest

To retrieve top friends an optional parameter of opensocial.DataRequest.PeopleRequestFields.FILTER with a value of opensocial.DataRequest.FilterType.TOP_FRIENDS must be set instead of using opensocial.DataRequest.PeopleRequestFields.SORT_ORDER.
People request does not implement opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS.

newFetchPersonRequest

If opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS is requested with a field that is not supported (see Person table above) a NOT_IMPLEMENTED error will be returned.

Default Data Retrieval

The default data retrieval mechanism has been simplified. If an opt_key is not provided when adding a request to a DataRequest object, the data from the response can be retrieved using the MyOpenSpace.RequestType enumeration as follows:

Request Type

MyOpenSpace.RequestType.FETCH_ALBUM

newFetchAlbumRequest

MyOpenSpace.RequestType.FETCH_ALBUMS

newFetchAlbumsRequest

MyOpenSpace.RequestType.FETCH_INDICATORS

newFetchIndicatorsRequest

MyOpenSpace.RequestType.FETCH_PEOPLE_FRIENDSHIP

newFetchPeopleFriendshipRequest

MyOpenSpace.RequestType.FETCH_PERSON_FRIENDSHIP

newFetchPersonFriendshipRequest

MyOpenSpace.RequestType.FETCH_PERSON_MOOD

newFetchPersonMoodRequest

MyOpenSpace.RequestType.FETCH_PERSON_STATUS

newFetchPersonStatusRequest

MyOpenSpace.RequestType.FETCH_PHOTO

newFetchPhotoRequest

MyOpenSpace.RequestType.FETCH_PHOTOS

newFetchPhotosRequest

MyOpenSpace.RequestType.FETCH_VIDEO

newFetchVideoRequest

MyOpenSpace.RequestType.FETCH_VIDEOS

newFetchVideosRequest

MyOpenSpace.RequestType.FETCH_PERSON

newFetchPersonRequest

MyOpenSpace.RequestType.FETCH_ACTIVITIES

newFetchActivitiesRequest

MyOpenSpace.RequestType.FETCH_PEOPLE

newFetchPeopleRequest

MyOpenSpace.RequestType.FETCH_PERSON_DATA

newFetchPersonAppDataRequest

MyOpenSpace.RequestType.REMOVE_PERSON_DATA

newRemovePersonAppDataRequest

MyOpenSpace.RequestType.UPDATE_PERSON_DATA

newUpdatePersonAppDataRequest

If more that one request of the same type is made, the first item can be retrieve directly using the enumeration value, the rest will have a _# postfix added to the enumeration value where # will be a sequential number starting with 1.

Example:

var container = opensocial.Container.get();
var request = this.container.newDataRequest();
request.add(request.newFetchPersonRequest(opensocial.IdSpec.PersonId.VIEWER)); // opt_key not set
request.add(request.newFetchPersonRequest(opensocial.IdSpec.PersonId.OWNER)); // opt_key not set
request.send(callback);
function callback(response){
    var viewer = response.get(MyOpenSpace.RequestType.FETCH_PERSON);
    var owner = response.get(MyOpenSpace.RequestType.FETCH_PERSON + "_1");
}


newUpdatePersonAppDataRequest now just accepts JSON as value

Now updatePersonAppDataRequest just accepts a valid JSON string. Trying to insert any other kind of value will result in an error.

Pagination

Random pagination is not supported, instead startIndex must be:

opensocial.DataRequest.PeopleRequestFields.FIRST =
opensocial.DataRequest.PeopleRequestFields.MAX * page + 1

Where page is the page number to retrieve starting with 0. Any other value will return and error.

If pagination is not set, startIndex will be 1 and itemsPerPage will be 20.

PostTo

PostTo message and share app has been deprecated in favor of requestSendMessage and requestShareApp.

requestPermission, hasPermission

requestPermission and hasPermission not longer accept the values in the MyOpenSpace.Permission.Field enumeration instead use:

MyOpenSpace.Permission.VIEWER_DISPLAY_ON_PROFILE
MyOpenSpace.Permission.VIEWER_DISPLAY_ON_HOME
MyOpenSpace.Permission.VIEWER_SEND_UPDATES_TO_FRIENDS
MyOpenSpace.Permission.VIEWER_SHOW_UPDATES_FROM_FRIENDS
MyOpenSpace.Permission.VIEWER_ACCESS_TO_PRIVATE_VIDEOS_PHOTOS
MyOpenSpace.Permission.VIEWER_ACCESS_TO_PUBLIC_VIDEOS_PHOTOS

RequestPermission accepts an array of MyOpenSpace.Permission objects at this point only the first valid non granted permission will be requested. If the array is empty, doesn't contain a valid MyOpenSpace.Permission object, or all the permission were already granted, an error will be returned.

The response of requestPermission will return a ResponseItem object. You can use hasError() to check if the operation was successful or not. If the permission was granted, an array containing the permission object will be returned when getData() is call. An error is returned if the permission was not granted.