">mixi Developer Center (mDC)

mixi Page Apps

mixi Page Apps (English) » Technical specification » Page API

Page API

mixi pages provide a space where the contents are customized and enhanced by the mixi social graph. mixi pages encourage communication between users through the variety of mixi content available. In addition, developers can create richer and more useful mixi page applications by using the Page API. An explanation of the Page API is provided here.

 

Common API specification

The Page API has been added as a part of the mixi Graph API.
A registered mixi page app can use the full mixi Graph API including the Page API.
For mixi Graph API details, please refer to 'mixi Graph API' (http://developer.mixi.co.jp/en/connect/mixi_graph_api/)
For the mixi API common specification, please refer to 'common API specification' (http://developer.mixi.co.jp/en/connect/mixi_graph_api/mixi_io_spec_top/api_common_spec)

The Page API doesn't support emoticon.

Prerequisites

In order to use the Page API, you must have obtained either or both of the items below.

  • Client authorized access token
  • User authorized access token for the "w_pagefeed" scope

You can't access the Page API with an access token granted for other scopes, you must use a token with "w_pagefeed" scope.
Use the same authorization method to get an access token for "w_pagefeed" as for other scopes.
Please refer to 'Authentication and Authorization Procedure' (http://developer.mixi.co.jp/en/connect/mixi_graph_api/api_auth)

For client authorization, please refer to 'Obtain an Access Token (Client authorization)' in the 'Technical specification overview' (http://developer.mixi.co.jp/en/page-apps/spec/summary/#toc-5)

Page API functions and the Access Token

Many functions are provided by Page API, they are classified into two groups the 'Inquiry group' and the 'Posting group'.
The following shows the corresponding access token that is necessary for Page API functions.

Classification Function Access token
Inquiry Obtain a page basic information
Obtain a feed list
Obtain a comment list
Obtain a number of favorites
Client authorized access token
Posting Post and delete a feed
Post and delete a comment
Post and delete a favorite
The user authorized access token for "w_pagefeed" scope

About "Content"

The Page API documentation includes words such as 'content' and the 'contentUri'.
The 'Content' indicates the information managed by mixi page apps.
For instance, the 'content' of a drawing app is the illustration drawn by the app.

The Page API adds feeds, comments and favorites to the URI(=contentUri) of the 'content'.

Parameters passed to apps on startup

The Page API documentation includes parameters passed to the mixi page app from the mixi page upon startup of the app.

Parameter name in documentation Parameter name when startup an app Description
Page-ID mixi_page_id mixi page ID
Module-ID mixi_module_id ID used to discriminate when multiple instances of the same app are installed on the mixi page

For details, please refer the 'PC, Smartphone' in the 'Technical specification overview' (http://developer.mixi.co.jp/en/page-apps/spec/summary/#toc-1), 'Mobile' in the (http://developer.mixi.co.jp/en/page-apps/spec/summary/#toc-2)
To startup an app from a page, the app needs to be installed on that mixi page.

Obtain a page's basic information

The URI to obtain a page's basic information is as follows.

GET http://api.mixi-platform.com/2/pages/[Page-ID]
Parameter name Value
Page-ID mixiページのID

The result is returned in JSON format as follows.

{
  "entry" : {
    "id" : "12345678901234567890",
    "displayName" : "mixi page name",
    "thumbnailUrls" : {
      "large" : "http://img.mixi.jp/img/basic/common/noimage_w180_001.gif",
      "medium" : "http://img.mixi.jp/img/basic/common/noimage_w76_001.gif",
      "small" : "http://img.mixi.jp/img/basic/common/noimage_w40_001.gif"
    },
    "details" : "mixi page description",
    "options" : {
      "zipCode" : "150-0011",
      "address" : "Sumitomo Fudousan Shibuya First Tower 7F, 1-2-20 Higashi, Shibuyaku, Tokyo",
      "pcUrl": "http://pc.my-home-page.jp",
      "mobileUrl": "http://mb.my-home-page.jp",
      "smartphoneUrl": "http://sp.my-home-page.jp" 
    },
    "followerCount" : 1000
  }
}

The information included in each entry is as follows.

Attribute name Description
id mixi page ID
displayName mixi page name
thumbnailUrls.large mixi page profile image (L) URL
thumbnailUrls.medium mixi page profile image (M) URL
thumbnailUrls.small mixi page profile image (S) URL
details text describing the mixi page
options.zipCode A zip code (If the page category is 'brand, product', 'event', 'entertainment', 'media', 'service, local shops, spot', 'business, organization')
options.address The address (If the page category is 'brand, product', 'event', 'entertainment', 'media', 'service, local shops, spot', 'business, organization')
option.pcUrl Homepage URL PC
option.mobileUrl Homepage URL Mobile
option.smartphoneUrl Homepage URL Smartphone
options.birthday Birthday (If the page category is 'celebrity, artist')
followerCount number of followers for this mixi page

Obtain a feed list

The URL to obtain a feed list is as follows.

GET http://api.mixi-platform.com/2/pages/[Page-ID]/feeds
Parameter name Value
Page-ID mixi page ID

In addition, the following query parameter is supported.

 

Parameter name Value
contentUri Specify a URL identifying a content feed. You can only get details for the specified feed.

The result is returned in JSON format as follows.

In the case where a list is returned

{
  "entry" : [
    {
      "contentUri" : "http://www.application.com/id=12345",
      "title" : "title",
      "body" : "body",
      "urls" : {
        "pcUrl" : "http://mixi.jp/run_page_appli.pl?page_id=0&module_id=0&appParams=%7B%22uid%22%3A%221569%22%7D",
        "mobileUrl" : "",
        "smartphoneUrl" : ""
      },
      "images" : [
        {
          "large" : "http://img.mixi.jp/img/basic/common/noimage_w180_001.gif",
          "medium" : "http://img.mixi.jp/img/basic/common/noimage_w76_001.gif",
          "small" : "http://img.mixi.jp/img/basic/common/noimage_w40_001.gif"
        }
      ],
      "user" : {
        "id" : "qgjw86yg5djw",
        "displayName" : "nickname",
        "thumbnailUrl" : "http://img.mixi.jp/img/basic/common/noimage_member180.gif"
      },
      "favoriteCount" : 4632,
      "commentCount" : 274,
      "sourceName" : "menu name",
      "created" : "2010-11-02T10:42:57+09:00"
    },
    ・・・
  ],
  ・・・
}

In the case where a contentUri was specified and only one was returned

{
  "entry" : {
    "contentUri" : "http://www.application.com/id=12345",
    "title" : "title",
    "body" : "body",
    "urls" : {
      "pcUrl" : "http://mixi.jp/run_page_appli.pl?page_id=0&module_id=0&appParams=%7B%22uid%22%3A%221569%22%7D",
      "mobileUrl" : "",
      "smartphoneUrl" : ""
    },
    "images" : [
      {
        "large" : "http://img.mixi.jp/img/basic/common/noimage_w180_001.gif",
        "medium" : "http://img.mixi.jp/img/basic/common/noimage_w76_001.gif",
        "small" : "http://img.mixi.jp/img/basic/common/noimage_w40_001.gif"
      }
    ],
    "user" : {
      "id" : "qgjw86yg5djw",
      "displayName" : "nickname",
      "thumbnailUrl" : "http://img.mixi.jp/img/basic/common/noimage_member180.gif"
    },
    "favoriteCount" : 4632,
    "commentCount" : 274,
    "sourceName" : "menu name",
    "created" : "2010-11-02T10:42:57+09:00"
  }
}

The information included in each entry is as follows.

Attribute name Description
contentUri Content URI
title Feed's title
body Feed body text
urls.pcUrl The permanent URL to navigate to the post originator (for PC)
urls.mobileUrl The permanent URL to navigate to the post originator (for mobile)
urls.smartphoneUrl The permanent URL to navigate to the post originator (for smartphone)
images.large The URL of a feed's attached image (large)
images.medium The URL of a feed's attached image (large)
images.small The URL of a feed's attached image (small)
user.id Feed poster's ID
user.displayName Feed poster's display name
user.thumbnailUrl Feed poster's profile image URL
favoriteCount Feed content favorite count
commentCount Feed content comment count
sourceName Name of application which posted the feed
created Feed creation date. W3C-DTF format.

Obtain a comment list

The URI to obtain a comment list is as follows.

GET http://api.mixi-platform.com/2/pages/[Page-ID]/comments
Parameter name Value
Page-ID mixi page ID

In addition, please specify the following query parameter.

Parameter name Value
contentUri URI-escaped URI of the feed for which you would favorite to obtain comments

The result is returned in the JSON format as follows.

{
  "entry" : [
    {
      "id" : "1FZ3P4ACUWBBC-20090520180336",
      "comment" : "comment body",
      "user" : {
        "id" : "qgjw87yg3djw",
        "displayName" : "nickname",
        "thumbnailUrl" : "http://img.mixi.jp/img/basic/common/noimage_member180.gif"
      },
      "created" : "2010-11-02T10:42:57+09:00"
    },
    ・・・
  ],
  ・・・
}

The information included for each entry is as follows.

Attribute name Description
id Comment-ID
comment Comment body
user.id Commenter's user ID
user.displayName URL for commenter's profile image
user.thumbnailUrl URL for commenter's profile image
created Feed creation date. W3C-DTFformat

Obtain a favorite count

The URI to obtain the favorite count is as follows.

GET http://api.mixi-platform.com/2/pages/[Page-ID]/favorites
Parameter name Value
Page-ID mixi page ID

In addition, please specify the following query parameter.

Parameter name Value
contentUri URI-escaped URI of content for which you wish to obtain favorite count

The result is returned in JSON format as follows.

{
  "count" : 3654
}

The information included in each entry is as follows.

Attribute name Description
count Content favorite count

Post and delete a feed

Post a feed

The URI to post a feed is as follows.

POST http://api.mixi-platform.com/2/pages/[Page-ID]/feeds
Parameter name Value
Page-ID mixi page ID

Post a feed without image

The feed's attributes should be sent as the request body in application/json format. Specify the request body as follows.

{
  "contentUri" : "http://www.application.com/id=12345",
  "title" : "title",
  "body" : "body",
  "urls" : {
    "pcUrl" : "http://mixi.jp/run_page_appli.pl?page_id=0&module_id=0&appParams=%7B%22uid%22%3A%221569%22%7D",
    "mobileUrl" : "",
    "smartphoneUrl" : "",
  },
  "sourceId" : "3"
}

Details of the feed attributes are as follows.

Attribute name Description
contentUri Content's URI
title Feed's title
body Feed body
urls.pcUrl The permanent URL to navigate to the post originator (for PC)
urls.mobileUrl The permanent URL to navigate to the post originator (for mobile)
urls.smartphoneUrl The permanent URL to navigate to the post originator (for smartphone)
sourceId Module-ID

If the 'contentUri' is omitted, the URL of the mixi page's feed detail screen will be used. If a page app will not post content feeds, please omit the 'contentUri'.

The 'sourceId' is used to determine the application name when posting the feed. You can only specify the module ID. If you specify the module ID as the sourceID, it will be displayed in the feed menu. If you omit it, the application name will be displayed.

※ Please note that currently mixi pages will only show the page administrator's posts.

Post a feed with an image

When posting a feed, an image can be associated with the feed. Two methods are provided.

  • Post a feed with the image's URL as an attribute (application/json format)
  • Post a feed with an attached image (multipart/form-data format)

Post a feed with the image's URL as an attribute (application/json format)

The Feed details are sent as the request body in application/json format. Feed attributes are specified as follows:

{
  "contentUri" : "http://www.application.com/id=12345",
  "title" : "title",
  "body" : "body",
  "urls" : {
    "pcUrl" : "http://mixi.jp/run_page_appli.pl?page_id=0&module_id=0&appParams=%7B%22uid%22%3A%221569%22%7D",
    "mobileUrl" : "",
    "smartphoneUrl" : "",
  },
  "sourceId" : "3",
  "imageUrls" : [
    "http://www.imageurl.com/image/photo1.jpeg"
  ]
}

Attribute details are as follows:

Attribute Description
contentUri Content URI
title Feed title
body Feed body
urls.pcUrl A permanent URL to navigate back to the post originator (for PC)
urls.mobileUrl A permanent URL to navigate back to the post originator (for mobile)
urls.smartphoneUrl A permanent URL to navigate back to the post originator (for smartphone)
sourceId Module ID
imageUrls A URL for an image to associate with the feed. You can specify only one image.

Supported image formats are jpeg and png.

Posting a feed with an attached image (multipart/form-data format)

An alternative method of associating an image with the feed, other then the above imageUrl attribute, is to post the feed with the image attached.

The URI for a posting a feed with an image is the same as a feed without an image. Specify 'multipart/form-data' as the Content-Type in the request header, and send the feed details and the image in the request body. Specify the feed attributes as JSON format, and the image as binary data. Details are as follows.

boundary string
Content-Disposition: form-data; name="request"
{
  "contentUri" : "http://www.application.com/id=12345",
  "title" : "title",
  "body" : "body",
  "urls" : {
    "pcUrl" : "http://mixi.jp/run_page_appli.pl?page_id=0&module_id=0&appParams=%7B%22uid%22%3A%221569%22%7D",
    "mobileUrl" : "",
    "smartphoneUrl" : "",
  },
  "sourceId" : "3",
}
boundary string 
Content-Disposition: form-data; name="image1"; filename="attached image1.jpg"
Content-Type: image/jpeg
.......attached image's binary data

Specifying contents are as follows.

Attribute name Description
contentUri Content URI
title Feed title
body Feed body
urls.pcUrl A permanent URL to navigate back to the post originator (for PC)
urls.mobileUrl A permanent URL to navigate back to the post originator (for mobile)
urls.smartphoneUrl A permanent URL to navigate back to the post originator (for smartphone)
sourceId Module-ID

For each element separated by a boundary string, please specify the part name as name="request", and the part name for the image as image="image1". You can specify only one image.Supported formats for an attached image are jpeg and png.

If the feed post succeeds, HTTP status code 201 and the following JSON will be returned as a response.

{
  "contentUri" : [contentUri]
}

Delete a feed

The URI to delete a feed is as follows.

DELETE http://api.mixi-platform.com/2/pages/[Page-ID]/feeds

 

Parameter name Value
Page-ID mixi page ID

In addition, please specify the following query parameter.

 

Parameter name Value
contentUri The URI escaped URI for the feed you wish to delete

If deleting a feed is successful, the HTTP status code 204 will be returned.

Post and delete a comment

Post a comment

The URI to post a comment is as follows.

POST http://api.mixi-platform.com/2/pages/[Page-ID]/comments

 

Parameter name Value
Page-ID mixi page ID

In addition, please specify the following query parameter.

 

Parameter name Value
contentUri The URI escaped URI for the feed you wish to post a comment for

The comment body is sent in the request body in application/json format. An example is as follows.

{
  "comment" : "comment body"
}

If the comment post succeeds, HTTP status code 201 and the following JSON will be returned in the response body.

{
  "id" : [Comment-ID]
}

Delete a comment

The URI for deleting a comment is as follows.

DELETE http://api.mixi-platform.com/2/pages/[Page-ID]/comments/[Comment-ID]

 

Parameter name Value
Page-ID mixi page ID
Comment-ID Comment-ID of comment you wish to delete

In addition, please specify the following query parameter.

 

Parameter name Value
contentUri URI escaped URI of the feed for which you wish to delete a comment

If the comment delete succeeds, HTTP status code 204 will be returned.

Post and delete a favorite

Post a favorite

The URI for posting a favorite is as follows.

POST http://api.mixi-platform.com/2/pages/[Page-ID]/favorites

 

Parameter name Value
Page-ID mixi page ID

In addition, please specify the following query parameter.

Parameter name Value
contentUri URI escaped URI of feed for feed for which want to post a favorite.

If a favorite post succeeds, HTTP status code 201 and the following JSON will be returned in the response body.

{
  "id" : [Favorite-ID]
}

Delete a favorite

The URI to delete a favorite for the feed is as follow.

DELETE http://api.mixi-platform.com/2/pages/[Page-ID]/favorites/[Favorite-ID]
Parameter name Value
Page-ID mixi page ID
Favorite-ID Favorite-ID of the favorite you wish to delete

In addition, please specify the following query parameter.

Parameter name Value
contentUri URI escaped URI of the feed for which you wish to delete a favorite

If deleting a favorite succeeds, HTTP status code 204 will be returned.

Paging

The Page API supports paging. Please refer to 'Paging' in the common API specification (http://developer.mixi.co.jp/en/connect/mixi_graph_api/mixi_io_spec_top/api_common_spec#toc-1)

TOP OF THIS PAGE