">mixi Developer Center (mDC)

mixi Apps

mixi Apps (English) » Technical Specification » Mobile » RESTful API Specifications

RESTful API Specifications

In mixi Mobile Apps*, Information related to user profile information and Friends** may be acquired with the API and used. Each API is compatible with the OpenSocial RESTful API.

(* In this document, mixi applications for mobile devices are referred to as "mixi Mobile Apps".)
(** The user’s friends are referred to as "Friend" or collectively "Friends".)

In order to access each API, a signature (OAuth Signature) using Consumer Key and Secret must be added. See API access with 2-legged OAuth for the method used to generate OAuth Signature.

The endpoint for mixi OpenSocial RESTful API is as follows.

http://api.mixi-platform.com/os/0.8

The following four types of API are usable. Acquirable fields and access controls are the same as for PC JavaScript APIs.

Person & Friends API

Acquires information related to user profiles and Friends.

/people/{guid}/@all
/people/{guid}/@friends
/people/{guid}/@self
/people/@me/@self

application/json format:

{
  "entry" : {
    "thumbnailUrl":"http://img.mixi.net/img/basic/common/noimage_member76.gif",
    "nickname":"ミクシィ開発部",
    "lastLogin":"2009-06-01T12:10:05Z",
    "name":{
      "formatted":"ミクシィ 開発部",
      "givenName":"ミクシィ",
      "familyName":"開発部"},
    "isViewer":"true",
    "hasApp":"true",
    "isOwner":"true",
    "id":"xxxxxxx",
    "updated":"2009-06-01T12:11:31Z",
    "displayName":"ミクシィ開発部"},
  "startIndex":0,
  "totalResults":1
}

application/atom+xml format:

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:osearch="http://a9.com/-/spec/opensearch/1.1">
  <entry>
    <content type="application/xml">
      <person xmlns="http://ns.opensocial.org/2008/opensocial">
        <id>urn:guid:mixi.jp:xxxxxxx</id>
        <displayName>ミクシィ開発部</displayName>
        <name>
          <familyName>開発部</familyName>
          <formatted>ミクシィ 開発部</formatted>
          <givenName>ミクシィ</givenName>
        </name>
        <nickname>ミクシィ開発部</nickname>
        <thumbnailUrl>http://img.mixi.net/img/basic/common/noimage_member76.gif</thumbnailUrl>
        <lastLogin>2009-06-01T12:10:05Z</lastLogin>
      </person>
    </content>
    <title/>
    <updated>2009-06-01T12:11:31Z</updated>
    <author/>
    <id>urn:guid:mixi.jp:xxxxxxx</id>
    <link href="http://img.mixi.net/img/basic/common/noimage_member76.gif" rel="alternate" type="image/jpeg"/>
  </entry>
  <osearch:startIndex>0</osearch:startIndex>
  <osearch:totalResults>1</osearch:totalResults>
</feed>

List of Acquirable Fields

Basic Information

Field name Details Format
nickname Nickname xs:string
profileUrl Profile URL xs:string
thumbnailUrl Profile image URL xs:string
hasApp Application usage status xs:boolean
bloodType Blood type
*A, AB, B, or O
xs:string

Profile information

Field name Details Format
addresses Address address Element
birthday Birthday xs:date
gender Gender xs:string

Specify item names delineated by commas in the fields parameter when acquiring information other than basic information.

/people/@me/@self?format=json&fields=birthday,gender

Acquisition of List of Friends Installing Applications

Specify hasApp in the filterBy parameter as shown below when using the Friends API to acquire a list of users who have the current mixi application installed.

/people/@me/@friends?format=json&filterBy=hasApp

mixi application response is improved by acquiring only the necessary data at the start. This has advantages for both developers and users. The basic requirement when accessing the Friends API is to set this filter.

Activity API

A function to notify Friends of the user’s activity.
Only creation, not acquisition, is currently supported.

/activities/{guid}/@self/@app

application/json format:

{"title":"hello, my friends.",
 "mobileUrl":"http://ma.mixi.net/1234/?url=http%3A%2F%2Fexample.com%2Ffoo",
 "url":"http://mixi.jp/run_appli.pl?id=3127",
 "mediaItems":[
  {"url":"http://example.com/images/activity.jpg",
   "mimeType":"image/jpeg"
  }],
 "recipients":["xxxxxxxx","yyyyyyyy"]
}

List of Specifiable Fields

Field Names Details
title Activity text
mobileUrl Activity link destination URL
Can specify the destination of a link clicked by a user.
Specifiable URLs are of the following two types.
Application execution URL: http://ma.mixi.net/[application ID]/
Application description URL: http://m.mixi.jp/view_appli.pl

Parameters may be passed to application execution URLs.
Example: http://ma.mixi.net/[application ID]/?url=http%3A%2F%2Fexample.com%2Ffoo

url Activity destination URL
Only PC-compatible applications may be specified. Used when the user accesses via a PC.
mediaItems
url Image URL*
mimeType Image MIME type*
recipients User ID when specifying destination

* Images specified in mediaItems must satisfy the following conditions.

Dimensions: Fixed at 40 x 40 pixels

Format: JPEG, GIF (animated GIFs not permitted)

Size: Up to 2kB

Persistence API

Stores user-related data on the mixi server in Key_Value format.

/appdata/{guid}/@self/@app
/appdata/{guid}/@friends/@app

application/json format:

{
  "entry" : {
    "mixi.jp:xxxxxx":{"subject":"appdata subject: 80","content":"appdata content: 86","updated":"2009-02-13T18:30:02Z"}
  },
  "startIndex":0,
  "id":["mixi.jp:xxxxxx"],
  "totalResults":1
}

application/atom+xml representation:

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:osearch="http://a9.com/-/spec/opensearch/1.1">
  <entry>
    <content type="application/xml">
      <appdata xmlns="http://ns.opensocial.org/2008/opensocial">
        <subject>appdata subject: 6</subject>
        <content>appdata content: 36</content>
        <updated>2009-02-13T18:30:02Z</updated>
      </appdata>
    </content>
    <title/>
    <updated/>
    <author>
      <url>urn:guid:mixi.jp:xxxxxxx</url>
    </author>
    <id>urn:guid:mixi.jp:xxxxxxx</id>
  </entry>
  <osearch:startIndex>0</osearch:startIndex>
  <osearch:totalResults>1</osearch:totalResults>
</feed>

Albums API

Permits acquisition of information for albums created by the user.

/albums/{guid}/@self
/mediaitems/{guid}/@self/{albumId}

application/json format:

{
  "link":null,
  "entry":[{
    "thumbnailUrl":"http://ic.mixi.jp/p/xxxxxxx.jpg",
    "id":"xxxxxxx",
    "title":"アルバム名"
  }],
  "startIndex":1,
  "itemsPerPage":1,
  "author":null,
  "totalResults":1
}

Classmates API

Permits acquisition of school divisions and tokens (a character string uniquely identifying a school) registered by the user with mixi classmates.
/classmates/@me/@schools

application/json format:

{
  "entry":[
    {"division":"【学校区分】","id":"mixi.jp:xxxxxxxx","token":"【学校トークン】"},
    ・・・
  ],
  "startIndex":0,
  "itemsPerPage":2,
  "totalResults":2
}

application/atom+xml format:

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:osearch="http://a9.com/-/spec/opensearch/1.1">
  <entry>
    <content type="application/xml">
      <school xmlns="http://mixi.jp/atom/ns#school">
        <token>【学校トークン】</token>
        <division>【学校区分】</division>
      </school>
    </content>
    <id>urn:guid:mixi.jp:xxxxxxxx</id>
  </entry>
  ・・・
  <osearch:startIndex>0</osearch:startIndex>
  <osearch:totalResults>2</osearch:totalResults>
  <osearch:itemsPerPage>2</osearch:itemsPerPage>
</feed>

List of Acquirable Fields

Field name Details Format
token School token xs:string
division School division xs:string

Usable Query Parameters

These query parameters are additional query parameters usable with any of the above. startIndex and count parameters are interpreted in accordance with the OpenSearch specifications.

format={format}         -- Output format (atom or json), initial setting is json
count={count}           -- Page size for page collection
fields={field}          -- List of fields to be included in results
startIndex={startIndex} -- Index for page collection
filterBy={fieldname}    -- Filter with specified filters (only for hasApp)

Specifiable guids

The specifiable ID for each API {guid} is limited to the person using the application. An error is returned if the user noted in the specified {guid} is not the person using the application.

Acquirable Information

In order to restrict access to information, rules are established in the mixi platform for acquisition and updating of APIs handling individual information and other user information.
These rules are referred to as a "permissions model".

The permissions model for mixi Mobile Apps is fundamentally similar to the PC version. However, with mixi Mobile Apps, as only users agreeing to the use of an application may use it, there is no distinction between VIEWER and OWNER. These two user classes are always identical.

The permission model is summarized as follows.

Acquisition of basic user information, profile information, and Friends information
User nstallation status Basic information Profile information Friends information
Owner
(Viewer)
Self Installed
Friends Installed ×
Not installed ×
  • ● – Acquirable
  • ○ – Acquirable if "Global Publication", "Open to Friends", or "Open to Friends of Friends
  • ▲– Acquirable unless user sets publication to OFF.
  • △– Acquirable if "Global Publication", unless user sets publication to OFF.
Acquisition and Update of Persistent Data
Target User Installation status Update (create, correct, delete) Acquired
Owner
(Viewer)
Self Installed
Friends Installed ×
Not installed × ×

» See the section on acquirable information for further details.

Reference:

OpenSocial Restful Protocol v0.8.1
http://www.opensocial.org/Technical-Resources/opensocial-spec-v081/restful-protocol

TOP OF THIS PAGE