Activity

Overview

Activity is an API which records a user’s activity history. The recorded activity is displayed in time series on the user’s friends’ My Page.

This API is included for the sake of maintaining compatibility with platforms for feature phones in Japan. Users’ activities are not actually displayed.

Activity Object Fields

The following is a list of Activity object fields which are Mobage open platform-compliant.

Value

Description

Type

Namespace

Notes

title

Title of Activity

xs:string

http://ns.opensocial.org/2008/opensocial

Do not allow unlimited user input in this field.

url

URL which Activity references (on PCs)

xs:string

http://ns.opensocial.org/2008/opensocial

Default is application top url

touchUrl

URL which Activity references (on smartphone Web browsers)

xs:string

http://ns.dena.jp/mbga/gameapi/v1

If omitted, default is application top url

body

Body of Activity

xs:string

http://ns.opensocial.org/2008/opensocial

Do not allow unlimited user input in this field.

mediaItems

Images relating to the Activity

xs:MediaItem (unbounded)

http://ns.opensocial.org/2008/opensocial

A maximum of three of the MediaItem type may be registered, and are displayed at 75x75 pixels on PC versions.

MediaItem Object Fields

Value

Description

Type

Namespace

Notes

url

URL of image

xs:string

http://ns.opensocial.org/2008/opensocial

type

Type of MediaItem

xs:string

http://ns.opensocial.org/2008/opensocial

Only 'image' type may be specified in this field.

mime_type

MimeType of MediaItem

xs:string

http://ns.opensocial.org/2008/opensocial

'image/gif', 'image/jpeg', 'image/png'

 


API Request

HTTP Method

Proxy Model

  • POST

Trusted Model


Endpoint URL

  • Sandbox Environment
    http://sb.sp.app.mbga.jp/api/restful/v1/activities/{guid}/{selector}/{appid}
  • Production Environment
    http://sp.app.mbga.jp/api/restful/v1/activities/{guid}/{selector}/{appid}

URI Template Parameters

guid

Only "@me" may be designated in the guid parameter.

Value

Description

Remarks

@me

viewer guid

Required

selector

Only "@self" may be designated in the selector parameter.

Value

Description

Notes

@self

A collection resource relating to the Activity information of the user which is specified with the guid parameter

Remarks

appid

Only "@app" may be designated in the appid parameter.

Value

Description

Remarks

@app

Application ID of viewer being executed

Required


Query Parameters

None.
 


OAuth Signed Request

This function allows secure transfers of data using OAuth Request Body Hash.
 
A xoauth_requestor_id must be included as either an authorized header or a query parameter.
The following values are designated by mode:
 
Proxy Mode
guid of viewer (value of opensocial_viewer_id sent from the Gadget Server)
 

API Responses

API response codes are selected from the following list:

Request HTTP Method

Response Code

Response Message

Description

POST

202

Accepted

Activity-generating request correctly received

POST

400

Bad Request

Bad request data

POST

401

Unauthorized

OAuth authorization failure

POST

403

Forbidden

Signifiies access not allowed for reasons other than authorization failure

POST

405

Method Not Allowed

Method not allowed

POST

500

Internal Server Error

Failure caused by problem with API

POST

503

Service Unavailable

Signifies POSTing more than the allowed Activity for a given user

 


Notes

  • HTML tags may not be included in title or body segments.
  • Do not allow users to freely enter title or body inputs.
  • Limit the title to a maximum of 42 single-byte or 21 double-byte characters.
    • Timestamp and the short game name will be in the header of the actual title display.
  • Limit the body to a maximum of 280 single-byte or 140 double-byte characters.
  • Limit Activity recording for a given user to one per minute. The API will return a 503 Service Unavailable message if requests exceeding the limit are sent.
  • Sending Activity using the Activity API has a priority of LOW.
    • At LOW priority, the Activity will be displayed only for the subgroup of friends who have the application installed.
    • At LOW priority, the Activity will not be displayed at the top of the user’s My Page, but only in the "See More" section of the "Friends’ Game Status".
    • If you want to send Activity at HIGH priority, use the Activity Service and not the Activity API.
  • When specifying multiple mediaItems in series, only the first image in the series will be displayed on mobile devices.
  • The Activity API will return a 403 response code if the user does not have the application in question installed.
     
OpenSocial RESTful Protocol Specification v0.9 - 7.3 Activity
XML Schema Part 2: Datatypes Second Edition
URI Template draft-gregorio-uritemplate-03
OAuth Request Body Hash 1.0 Draft 4

Revision History

  • 12/11/2012
    • Initial release.

 

 

PREVIOUS

Payment

NEXT

Message