Skip to main content

People

Overview​

The People API is used to get a user's profile and a list of the user's friends.


People Object Fields​

The following is a list of People object fields supported by the Mobage Open Platform. jobType and bloodtype are proprietary extensions.

ValueDescriptionTypeNamespaceRemark
idUser IDxs:stringhttp://ns.opensocial.org/2008/opensocial–
nicknameNicknamexs:stringhttp://ns.opensocial.org/2008/opensocial–
displayNameSynonymous with nicknamexs:stringhttp://ns.opensocial.org/2008/opensocial–
aboutMeSelf introductionxs:stringhttp://ns.opensocial.org/2008/opensocial–
birthdayBirthdayxs:datehttp://ns.opensocial.org/2008/opensocial–
interestsInterestsxs:stringhttp://ns.opensocial.org/2008/opensocialArbitrary input text entered by the user
profileUrlURL of the profilexs:stringhttp://ns.opensocial.org/2008/opensocial–
thumbnailUrlURL of the thumbnail imagexs:stringhttp://ns.opensocial.org/2008/opensocial–
genderGenderxs:stringhttp://ns.opensocial.org/2008/opensocial"male" or "femail" or "undisclosed"
addressesRegiontns:Addresshttp://ns.opensocial.org/2008/opensocialState/province listed in the profile
jobTypeOccupationxs:stringhttp://ns.dena.jp/mbga/gameapi/v1Arbitrary text entered by the user
bloodTypeBlood typexs:stringhttp://ns.dena.jp/mbga/gameapi/v1Either "A"
hasAppBoolean value indicating whether the application is installedxs:booleanhttp://ns.opensocial.org/2008/opensocial–
isVerifiedBoolean value indicating if personal authentication has been completedxs:booleanhttp://ns.dena.jp/mbga/gameapi/v1–
isFamousBoolean value indicating if the user is a virtual user or a celebrityxs:booleanhttp://ns.dena.jp/mbga/gameapi/v1–
gradeUser gradexs:inthttp://ns.dena.jp/mbga/gameapi/v1Either "1":Guest Account

API Request​

HTTP Methods​

Proxy model

  • Get - Gets the user's profile, the user's friends list, or a friend's profile

Trusted model

  • Get - Gets the user's profile, the user's friends list, or a friend's profile


Endpoint URL​

  • Sandbox environment

    http://sb.sp.app.mbga.jp/api/restful/v1/people/{guid}/{selector}{-prefix|/|pid}
  • Production environment

    http://sp.app.mbga.jp/api/restful/v1/people/{guid}/{selector}{-prefix|/|pid}

URI Template Parameters​

guid​

Specify one of the following values for the guid parameter.

ValueDescriptionRemark
@meguid of the viewerRequired
{guid}User IDRequired

Before a valid Mobage user ID can be specified with the guid parameter, the user must have installed the associated application.

selector​

Specify one of the following values for the selector parameter.

ValueDescriptionRemark
@selfEntry resource for the profile of the user specified in the guid parameterRequired
@friendsCollection resource containing the friends of the user specified in the guid parameterRequired
@allSynonymous with @friendsRequired
pid​

You can specify the pid parameter when selector is @friends or @all.

ValueDescriptionRemark
{guid}Actual user ID that is valid in MobageOptional

Query Parameters​

The following query parameters can be specified.

format​

The response format is as shown below.

ValueDescriptionRemark
json"application/json; charset=utf8"Optional, default value

fields​

Here, you can specify profile attributes that you wish to obtain. For the fields that can be specified, please see the description of the People object fields.
To specify multiple fields, separate them with commas without any spaces in between.
If you omit the fields parameter, all of the attributes listed below are obtained.

In the interest of performance, you should only get the attributes that you need.

count​

When getting a response as a collection resource, you can use the count field to specify the maximum number of entries to obtain. You can include the count field when selector is @friends or @all.

count can be a maximum of 1000, with a default value of 50.

startIndex​

For startindex, specify the starting value of the collection resource. If startindex is omitted, 1 is assumed. For example, if there are a total of 100 entries of friends information and they are being displayed as 8 entries per page, then to get the entries forthe second page, you should set count to 8 and startIndex to 9.

filterBy​

You can use filterBy when selector is @friends or @all.

If you use filterBy, you can add a search condition for the collection of person objects that will be returned in the response. For the filterBy value, specify a field that will be used as the search condition key.

The filterBy values that can currently be specified are shown below.

filterByDescription
hasAppCheck to see if the application is installed

When filterBy is specified, filterOp and filterValue must also be specified.

filterOp​

You can use filterOp when selector is @friends or @all.

By using filterOp, you can add a search condition for the collection of person objects that will be returned in the response. The filterOp value indicates how the search condition key and value should be evaluated.

The filterOp values that can currently be specified are shown below.

filterOpDescription
equalsThe field specified by filterBy must match the value specified by filterValue

When filterOp is specified, filterBy and filterValue must also be specified.

filterValue​

You can use filterValue when selector is @friends or @all.

By using filterValue, you can add a search condition for the collection of person objects that will be returned in the response. filterValue indicates the value to be used when evaluating the search condition key.

The values of filterValue that can currently be specified are shown below.

filterValueDescription
trueTrue
falseFalse

When filterValue is specified, filterBy and filterOp must also be specified.


API Response​

Response Codes​

The following is a list of the API response codes.

Request HTTP methodResponse codeResponse messageDescription
GET200OKThe data was acquired successfully
GET400Bad RequestInvalid request data
GET401UnauthorizedOAuth authorization failed
GET403ForbiddenAccess failed for some reason other than an authentication error
GET405Method Not AllowedMethod is not allowed
GET500Internal Server ErrorFailed because of an API problem

Notes​

  • Changes to a friends list may not be reflected for up to 10 minutes in the list that is obtained when selector is @friend or @all to prevent the processing load from becoming excessive.

  • If a user is recognized as an invalid user by the Review Department, then that user will be considered as not authenticated even if isVerified indicates that the user has been authenticated.

  • If a user has not set aboutMe, jobType, or bloodType, the values returned will be null.

  • The user specified by guid must exist otherwise 404 will be returned for the response code.

  • If fields is set to hasApp and the user has not installed the corresponding application, 200 will be returned for the response code along with a logical value.

  • Since a user for which isFamous is true will be a virtual user who is managed by Mobage, that user will not use the application and will be handled differently from an ordinary user.
     


    Examples​

    Getting the viewer's Profile​

    This example shows how to get the id, nickname, profileUrl and thumbnailUrl fields of the viewer's profile in application/json format.

    Request Format​

GET /api/restful/v1/people/@me/@self?fields=id,nickname,profileUrl,thumbnailUrl&format=json

Response Format​

200 OK
Content-Type: application/json; charset=utf8

{
"startIndex" : 1,
"person" : {
"nickname" : "Taro Mobage",
"thumbnailUrl" : "http://sb-sp.mbga.jp/img_u/10000/0.0.gif",
"id" : "sp.sb.app.mobage.kr:10000",
"hasApp" : true,
"profileUrl" : "http://sb-sp.mbga.jp/_u?u=10000"
},
"itemsPerPage" : 1,
"totalResults" : 1
}

This example shows how to get all fields of the viewer's profile when the user is verified. The user grade is 3.

Request Format​

GET /api/restful/v1/people/@me/@self?format=json

Response Format​

200 OK
Content-Type: application/json; charset=utf8

{
"startIndex" : 1,
"person" : {
"grade" : 3,
"hasApp" : true,
"isVerified" : true,
"bloodType" : "A",
"aboutMe" : "自己紹介文",
"id" : "sb.mbga.jp:10000",
"isFamous" : false,
"birthday" : "1990-01-02",
"displayName" : "Mobage太郎",
"gender" : "male",
"interests" : "趣味",
"thumbnailUrl" : "http://sb-sp.mbga.jp/img_u/10000/0.0.gif",
"nickname" : "Mobage太郎",
"jobType" : "職業",
"profileUrl" : "http://sb-sp.mbga.jp/_u?u=10000",
"addresses" : [
{
"formatted" : "東京都"
}
]
},
"itemsPerPage" : 1,
"totalResults" : 1
}

Getting the viewer's friends information​

This example shows how to get the id, nickname, profileUrl and thumbnailUrl fields of the viewer's friends in application/json format.

Request Format​

GET /api/restful/v1/people/@me/@friends?fields=id,nickname,profileUrl,thumbnailUrl,hasApp&format=json&count=10&startIndex=1

Response Format​

200 OK
Content-Type: application/json; charset=utf8

{
"entry" : [
{
"nickname" : "Friend A",
"thumbnailUrl" : "http://sb-sp.mbga.jp/img_u/10001/0.0.gif",
"id" : "sp.sb.app.mobage.kr:10001",
"hasApp": true,
"profileUrl" : "http://sb-sp.mbga.jp/_u?u=10001"
},
{
"nickname" : "Friend B",
"thumbnailUrl" : "http://sb-sp.mbga.jp/img_u/10002/0.0.gif",
"id" : "sp.sb.app.mobage.kr:10002",
"hasApp": false,
"profileUrl" : "http://sb-sp.mbga.jp/_u?u=10002"
},
{
"nickname" : "Friend C",
"thumbnailUrl" : "http://sb-sp.mbga.jp/img_u/10003/0.0.gif",
"id" : "sp.sb.app.mobage.kr:10003",
"hasApp" : true,
"profileUrl" : "http://sb-sp.mbga.jp/_u?u=10003"
}
],
"startIndex" : 1,
"itemsPerPage" : 10,
"totalResults" : 3
}

OpenSocial RESTful Protocol Specification v0.9 - 7.1 People
XML Schema Part 2: Datatypes Second Edition
URI Template draft-gregorio-uritemplate-03

Revision History​

  • 12/11/2012
    • Initial Release.