TextData API

 

Abstract

The TextData API supports the development of a bulletin board system that stores and retrieves users' text entries. To support nested comments, text entries can have parent-child relationships with one another.
Use this API only to store text that is interpretable as sentences. If you use this class to store other types of text, such as key-value pairs, the system administrator may delete the text at any time. In addition, if you attempt to store text that violates the Mobage terms of service, such as text that contains profanity, you will receive an error.
Before using this API, you must create at least one TextDataGroup, or topic, for grouping bulletin board comments by using 2-legged (Trusted model) API accesses.

For more information about the REST API, see the Mobage REST API Reference on the Mobage Developer Site.

 

 

HTTP Method

2-legged Authentication (Trusted model)

3-legged Authentication (Proxy model)

textdatagroup.create

Create a new text data group.

REST Base URI

http://sp.mbga-platform.jp/social/api/restful/v2 ( Service )
http://sb.sp.mbga-platform.jp/social/api/restful/v2 ( Sandbox )

REST HTTP Method

POST

REST URI Fragment

/textdata/{appId}/{groupId}

REST Query Parameters

Create-TextDataGroup-Request-Parameters

Return Object

none

Authorization

type

permission

description

ANONYMOUS

false

access without authentication

SECURITY_TOKEN

false

access with a security token

OAUTH_MOBILE

false

access with OAuth Token issued for Mobile

OAUTH_CONSUMER

true

access with an authentication by Consumer Request

RESTful API Response Code

HTTP Status Code

HTTP Status Message

JSON-RPC Error Codes

Meaning

201

Created

successful in creating a data

400

Bad Request

-32700, -32600, -32601, -32602, 400

illegal request data from the client

401

Unauthorized

401

authentication error

403

Forbidden

403

the resource exists, but unable to access for a reason other than authentication error

404

Not Found

404

the resource doesn't exist

405

Method Not Allowed

405

you are not allowed to perform the method

500

Internal Server Error

-32603

an error was occured in the API server

503

Service Unavailable

API service is temporary unavailable

JSON-RPC Error Code

An error value identifying the error type, contained in the "code" field of the Error object.

RPC Code

Meaning

-32700 (Parse error)

illegal JSON format

-32600 (Invalid Request)

illegal JSON-RPC request

-32601 (Method not found)

the method doesn't exist nor is available

-32602 (Invalid params)

illegal API request parameters

-32603 (Internal server error)

an error occured in the API server

400 (Bad Request)

illegal request from the client for a reason other than the other errors

401 (Unauthorized)

authentication error

403 (Forbidden)

the resource exists, but unable to access for a reason other than authentication error

404 (Not Found)

the resource doesn't exist

405 (Method Not Allowed)

you are not allowed to perform the method

Data Type

Create-TextDataGroup-Request-Parameters

Specify appId and groupId as URI Template Parameters, and then specify the other parameters as Query String.

Name

Type

Description

appId

AppId

Required '@app' only

groupId

GroupId

Required '@all' only

  • Base Data Type
    • Starndard-Request-Parameters

TextdataGroup

Name

Type

Description

name

String

the name of the textdataGroup you create

parentId

String

the id to represent parent-child relationships

name field

Alphabets and '_' are only available with a maximum size of 32 bytes.

parentId field

You are required to specify the parentId of the new TextDataGroup to represent parent-child relationships. Because the id is required for observations, please specify the id in every case of using data structures with parent-child relationships.

restriction

The number of TextDataGroups for each application is up to 5.

sample data

RESTful API

create a new TextDataGroup
POST /social/api/restful/v2/textdata/@app/@all

{ "name": "diary" }

HTTP/1.1 201 Created

If the TextDataGroup you want to create already exists or the number of TextDataGroup reaches the limit, then the status will be Bad Request.

POST /social/api/restful/v2/textdata/@app/@all

{ "name": "diary" }

HTTP/1.1 400 Bad Request

{
   "Error" : {
      "Code" : "400",
      "Message" : "Bad Request"
   }
}

textdatagroup.get

Retrieve the specified TextDataGroup.

API Definition

REST Base URI

http://sp.mbga-platform.jp/social/api/restful/v2 ( Service )
http://sb.sp.mbga-platform.jp/social/api/restful/v2 ( Sandbox )

REST HTTP Method

GET

REST URI Fragment

/textdata/{appId}/{groupId}
/textdata/{appId}/{textdataGroupName}{-prefix|/|groupId}

REST Query Parameters

Get-TextDataGroup-Request-Parameters

Return Object

TextDataGroup
Collection<TextDataGroup>

Authorization

type

permission

description

ANONYMOUS

false

access without authentication

SECURITY_TOKEN

false

access with a security token

OAUTH_MOBILE

false

access with OAuth Token issued for Mobile

OAUTH_CONSUMER

true

access with an authentication by Consumer Request

RESTful API Response Code

HTTP Status Code

HTTP Status Message

JSON-RPC Error Codes

Meaning

200

OK

successful in creating a data

400

Bad Request

-32700, -32600, -32601, -32602, 400

illegal request data from the client

401

Unauthorized

401

authentication error

403

Forbidden

403

the resource exists, but unable to access for a reason other than authentication error

404

Not Found

404

the resource doesn't exist

405

Method Not Allowed

405

you are not allowed to perform the method

500

Internal Server Error

-32603

an error occured in the API server

503

Service Unavailable

API service is temporary unavailable

JSON-RPC Error Code

An error value identifying the error type, contained in the "code" field of the Error object.

RPC Code

Meaning

-32700 (Parse error)

illegal JSON format

-32600 (Invalid Request)

illegal JSON-RPC request

-32601 (Method not found)

the method doesn't exist nor is available

-32602 (Invalid params)

illegal API request parameters

-32603 (Internal server error)

an error occured in the API server

400 (Bad Request)

illegal request from the client for a reason other than the other errors

401 (Unauthorized)

authentication error

403 (Forbidden)

the resource exists, but unable to access for a reason other than authentication error

404 (Not Found)

the resource doesn't exist

405 (Method Not Allowed)

you are not allowed to perform the method

Data Type

Get-TextDataGroup-Request-Parameters

Specify appId, groupId, and textdataGroupName as URI Template Parameters, and then specify the other parameters as Query String.

Name

Type

Description

appId

AppId

Required '@app' only

groupId

GroupId

Required '@all' only

textdataGroupName

String

the name of the TextDataGroup

  • Base Data Type
    • Standard-Request-Parameters
    • Collection-Request-Parameters
Starndard-Request-Parameters

The following fields are supported.

Name

Type

Description

format

String

Optional 'json' only

See [ 6.1 Standard Request Parameters - OpenSocial Core API Server Specification|http://opensocial-resources.googlecode.com/svn/spec/1.0/Core-API-Server.xml#Standard-Request-Parameters] for more details.

Collection-Request-Parameters

The following fields are supported.

Name

Type

Description

count

Number

Optional, an integer over 0 and below 1001, the default value is set to 50

startIndex

Number

Optional, an integer over 0

See 6.2 Collection Request Parameters - OpenSocial Core API Server Specification for more details.

TextDataGroup

Name

Type

Description

id

String

the id of the TextDataGroup

name

String

the name of the TextDataGroup

appId

String

the id of the application

parentId

String

the id of the parent TextDataGroup object

Sample Data

RESTful API

Retrieve a TextDataGroup collection
GET /social/api/restful/v2/textdata/@app/@all
Host: sb.sp.mbga-platform.jp

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
   "entry" : [
      {
         "parentId" : "0",
         "appId" : "sb.mbga.jp:12000000",
         "name" : "dialy",
         "id" : "1"
      },
      {
         "parentId" : "1",
         "appId" : "sb.mbga.jp:12000000",
         "name" : "comment",
         "id" : "2"
      },
   ],
   "startIndex" : 1,
   "itemsPerPage" : 50,
   "totalResults" : 2
}
Retrieve a specified TextDataGroup information
GET /social/api/restful/v2/textdata/@app/diary/@self
Host: sb.sp.mbga-platform.jp

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
    "parentId" : "0",
    "appId" : "sb.mbga.jp:12000000",
    "name" : "dialy",
    "id" : "1"
}

textdatagroup.delete

Delete a TextDataGroup entry.

API Definition

REST Base URI

http://sp.mbga-platform.jp/social/api/restful/v2 ( Service )
http://sb.sp.mbga-platform.jp/social/api/restful/v2 ( Sandbox )

REST HTTP Method

DELETE

REST URI Fragment

/textdata/{appId}/{textdataGroupName}{-prefix|/|groupId}

REST Query Parameters

Delete-TextDataGroup-Request-Parameters

Return Object

Objecd-Id

Authorization

type

permission

description

ANONYMOUS

false

access without authentication

SECURITY_TOKEN

false

access with a security token

OAUTH_MOBILE

false

access with OAuth Token issued for Mobile

OAUTH_CONSUMER

true

access with an authentication by Consumer Request

RESTful API Response Code

HTTP Status Code

HTTP Status Message

JSON-RPC Error Codes

Meaning

201

Accepted

successful in creating a data

400

Bad Request

-32700, -32600, -32601, -32602, 400

illegal request data from the client

401

Unauthorized

401

authentication error

403

Forbidden

403

the resource exists, but unable to access for a reason other than authentication error

404

Not Found

404

the resource doesn't exist

405

Method Not Allowed

405

you are not allowed to perform the method

500

Internal Server Error

-32603

an error occured in the API server

503

Service Unavailable

API service is temporary unavailable

JSON-RPC Error Code

An error value identifying the error type, contained in the "code" field of the Error object.

RPC Code

Meaning

-32700 (Parse error)

illegal JSON format

-32600 (Invalid Request)

illegal JSON-RPC request

-32601 (Method not found)

the method doesn't exist nor is available

-32602 (Invalid params)

illegal API request parameters

-32603 (Internal server error)

an error occured in the API server

400 (Bad Request)

illegal request from the client for a reason other than the other errors

401 (Unauthorized)

authentication error

403 (Forbidden)

the resource exists, but unable to access for a reason other than authentication error

404 (Not Found)

the resource doesn't exist

405 (Method Not Allowed)

you are not allowed to perform the method

Data Type

Delete-TextDataGroup-Request-Parameters

Specify appId, groupId, and textdataGroupName as URI Template Parameters, and then specify the other parameters as Query String.

Name

Type

Description

appId

AppId

Required '@app' only

groupId

GroupId

Required '@self' only

textdataGroupName

String

the name of the TextDataGroup

  • Base Data Type
    • Standard-Request-Parameters
Starndard-Request-Parameters

The following fields are supported.

Name

Type

Description

format

String

Optional 'json' only

See 6.1 Standard Request Parameters - OpenSocial Core API Server Specification for more details.

Sample Data

RESTful API

Delete a TextDataGroup entry
DELETE /social/api/restful/v2/textdata/@app/diary/@self
Host: sb.sp.mbga-platform.jp

HTTP/1.1 202 Accepted

"1"

textdata.create

Create a new text entry.

API Definition

REST Base URI

http://sp.mbga-platform.jp/social/api/restful/v2 ( Service )
http://sb.sp.mbga-platform.jp/social/api/restful/v2 ( Sandbox )

REST HTTP Method

POST

REST URI Fragment

/textdata/{appId}/{textdataGroupName}{-prefix|/|groupId}

REST Query Parameters

Create-TextData-Request-Parameters

Return Object

TextData

Authorization

type

permission

description

ANONYMOUS

false

access without authentication

SECURITY_TOKEN

false

access with a security token

OAUTH_MOBILE

false

access with OAuth Token issued for Mobile

OAUTH_CONSUMER

true

access with an authentication by Consumer Request

RESTful API Response Code

HTTP Status Code

HTTP Status Message

JSON-RPC Error Codes

Meaning

201

Created

successful in creating a data

400

Bad Request

-32700, -32600, -32601, -32602, 400

illegal request data from the client

401

Unauthorized

401

authentication error

403

Forbidden

403

the resource exists, but unable to access for a reason other than authentication error

404

Not Found

404

the resource doesn't exist

405

Method Not Allowed

405

you are not allowed to perform the method

500

Internal Server Error

-32603

an error occured in the API server

503

Service Unavailable

API service is temporary unavailable

JSON-RPC Error Code

An error value identifying the error type, contained in the "code" field of the Error object.

RPC Code

Meaning

-32700 (Parse error)

illegal JSON format

-32600 (Invalid Request)

illegal JSON-RPC request

-32601 (Method not found)

the method doesn't exist nor is available

-32602 (Invalid params)

illegal API request parameters

-32603 (Internal server error)

an error occured in the API server

400 (Bad Request)

illegal request from the client for a reason other than the other errors

401 (Unauthorized)

authentication error

403 (Forbidden)

the resource exists, but unable to access for a reason other than authentication error

404 (Not Found)

the resource doesn't exist

405 (Method Not Allowed)

you are not allowed to perform the method

Data Type

Create-TextData-Request-Parameters

Specify appId, groupId, and textdataGroupName as URI Template Parameters, and then specify the other parameters as Query String.

Name

Type

Description

appId

AppId

Required '@app' only

groupId

GroupId

Required '@all' only

textdataGroupName

String

the name of the TextDataGroup

  • Base Data Type
    • Starndard-Request-Parameters
Starndard-Request-Parameters

The following fields are supported.

Name

Type

Description

format

String

Optional 'json' only

See Standard Request Parameters - OpenSocial Core API Server Specification for more details.

TextData

Name

Type

Description

data

String

a text data

parentId

String

the id of the parent TextData object

writerId

String

the UserId of the writer

ownerId

String

the UserId of the owner

Notice

  • The size of a data is up to 2048 bytes.
  • You are required to specify the parentId of the new TextDataGroup to represent parent-child relationships. Because the id is required for observations, please specify the id in every case of using data structures with parent-child relationships.
  • Use the "data" field only to store text that is interpretable as sentences. If the data is not interpretable as sentences, the system administrator may delete the text at any time.
  • if you attempt to store text that violates the Mobage terms of service, such as text that contains profanity, you will receive 400 Bad Request error.
  • TextData#ownerId is a field to store the id of the user who owns all text entries for the specified topic.
    • For example, when an user attempts to write a text into a message board assigned to each user, you need to specify the id of the owner of the message board in TextData#ownerId.
    • Another example will be that the board is not specifically assigned to a user, but to a group like a guild, in this case you'll need to set the TextData#ownerId as blank.
  • If you use 2-legged authentication, you are required to specify TextData#writerId for creating and updating an entry. If you don't specify the id, it will be set to 0 automatically. The id 0 means you, the partner. If you use 3-legged authentication, the UserId of the user, who logged in, will be set automatically.
  • If the user of TextData#ownerId has specified the viewer in his or her black list, you are required to restrict the writing by using BlackList API.

Constraint

  • The max number of entries that you can contain in one TextDataGroup is up to 100,000 when the number of the users who installed the application is up to 10,000.
    • If the number of the users who installed the application up until yesterday exceeds 10,000, then the limit will be <the sum as of yesterday> times 10.
  • If the number of the entries exceeds the limit, then some of them in the group are deleted in chronological order (with the Error Code "404 Not Found").
  • Please be careful not to manage the TextData entries that belong to different categories in the same TextDataGroup ID. (For example, please separate "Greeting" entries from "Meeting" entries with different TextDataGroup IDs. If you want to display both the "Title" and "Mission" in different columns of "Meeting" form, you can make them belong to the same TextDataGroup ID.)

Sample Data

RESTful API

create a new TextData entry

An example that the user with the UserID 10012 commented to the board located in the MyPage for the user 10009.

POST /social/api/restful/v2/textdata/@app/comment/@all
Host: sb.sp.mbga-platform.jp

{  
   "data": "I love Ninja Loyale!",
   "writerId": "10012",
   "ownerId": "10009"
}

HTTP/1.1 201 Created

{
   "status" : 0,
   "data" : "I love Ninja Loyale!",
   "published" : "2010-10-04T09:05:28",
   "writerId" : "sb.mbga.jp:10012",
   "parentId" : "0",
   "id" : "22",
   "updated" : "2010-10-04T09:05:28",
   "groupName" : "comment",
   "ownerId" : "sb.mbga.jp:10009"
}

If the posted data contains profanity, you will receive 400 Bad Request error.

POST /social/api/restful/v2/textdata/@app/comment/@all
Host: sp.sb.mobage-platform.kr

{ "data": "If you post data that contains profanity, for example "kill you", in boards, then the administrators may delete the post." }

HTTP/1.1 400 Bad Reqeut

{
   "Error" : {
      "Code" : "400",
      "Message" : "Bad Request"
   }
}

textdata.get

Retrieve a TextData entry.

API Definition

REST Base URI

http://sp.mbga-platform.jp/social/api/restful/v2 ( Service )
http://sb.sp.mbga-platform.jp/social/api/restful/v2 ( Sandbox )

REST HTTP Method

GET

REST URI Fragment

/textdata/{appId}/{textdataGroupName}{-prefix|/|groupId}
/textdata/{appId}/{textdataGroupName}{groupId}{-prefix|/|textdataId}

REST Query Parameters

Get-TextData-Request-Parameters

Return Object

TextData

Authorization

type

permission

description

ANONYMOUS

false

access without authentication

SECURITY_TOKEN

false

access with a security token

OAUTH_MOBILE

false

access with OAuth Token issued for Mobile

OAUTH_CONSUMER

true

access with an authentication by Consumer Request

RESTful API Response Code

HTTP Status Code

HTTP Status Message

JSON-RPC Error Codes

Meaning

200

OK

successful in retrieving a data

400

Bad Request

-32700, -32600, -32601, -32602, 400

illegal request data from the client

401

Unauthorized

401

authentication error

403

Forbidden

403

the resource exists, but unable to access for a reason other than authentication error

404

Not Found

404

the resource doesn't exist

405

Method Not Allowed

405

you are not allowed to perform the method

500

Internal Server Error

-32603

an error occured in the API server

503

Service Unavailable

API service is temporary unavailable

JSON-RPC Error Code

An error value identifying the error type, contained in the "code" field of the Error object.

RPC Code

Meaning

-32700 (Parse error)

illegal JSON format

-32600 (Invalid Request)

illegal JSON-RPC request

-32601 (Method not found)

the method doesn't exist nor is available

-32602 (Invalid params)

illegal API request parameters

-32603 (Internal server error)

an error occured in the API server

400 (Bad Request)

illegal request from the client for a reason other than the other errors

401 (Unauthorized)

authentication error

403 (Forbidden)

the resource exists, but unable to access for a reason other than authentication error

404 (Not Found)

the resource doesn't exist

405 (Method Not Allowed)

you are not allowed to perform the method

Data Type

Get-TextData-Request-Parameters

Specify appId, groupId, and textdataGroupName as URI Template Parameters, and then specify the other parameters as Query String.

Name

Type

Description

appId

AppId

Required '@app' only

groupId

GroupId

Required '@all' only

textdataGroupName

String

the name of the TextDataGroup

fields

Array<String>

Optional

  • Base Data Type
    • Starndard-Request-Parameters
    • Collection-Request-Parameters
Starndard-Request-Parameters

The following fields are supported.

Name

Type

Description

format

String

Optional 'json' only

See 6.1 Standard Request Parameters - OpenSocial Core API Server Specification for more details.

Collection-Request-Parameters

The following fields are supported.

Name

Type

Description

filterBy

String or Array<String>

Optional, 'ownerId' or 'writerId'

filterOp

String or Array<String>

Optional, 'equals' only

filterValue

String or Array<String>

Optional, required when 'filterBy' is specified

count

Number

Optional, an integer over 0 and below 1001, the default value is set to 50

sortBy

String

Optional, 'id' or 'updated'

sortOrder

String

Optional, 'ascending' or 'descending'

startIndex

Number

Optional, an integer over 0

See 6.2 Collection Request Parameters - OpenSocial Core API Server Specification for more details.

TextData

Name

Type

Description

id

String

the id of the TextData object

groupName

String

the name of the TextDataGroup object

parentId

String

the id of the parent TextData object

writerId

String

the UserId of the writer

ownerId

String

the UserId of the owner

data

String

the text data

status

Number

the value of the status

published

DateTime

the published date

updated

DateTime

the updated date

status field

status

Description

0

normal

11

edit by an user

20

deletion by an operator

21

edit by an operator

31

edit by the partner

Note
  • The DateTime type data in the response from the APIs doesn't include the TimeZone identifier. Thus, the data is described as GMT (Greenwich Meridian Time).
  • If you specify multiple ids in a GET request, please specify the ids that belong to the same group. You can't retrieve ids that belong to different groups.

Sample Data

RESTful API

retrieve TextData collection

Retrieves two TextData entries that belong to the comment ordered by writerId ascending.

GET /social/api/restful/v2/textdata/@app/comment/@all?sortBy=writerId&sortOrder=ascending&count=2
Host: sb.sp.mbga-platform.jp

HTTP/1.1 200 OK

{
   "entry" : [
      {
         "status" : 0,
         "data" : "comment01",
         "writerId" : "sb.mbga.jp:12345",
         "published" : "2010-10-10T10:10:10",
         "parentId" : "0",
         "groupName" : "comment",
         "updated" : "2010-10-10T10:10:10",
         "id" : "10",
         "ownerId" : "sb.mbga.jp:23456"
      },
      {
         "status" : 21,
         "data" : "comment02",
         "writerId" : "sb.mbga.jp:23456",
         "published" : "2010-10-10T11:11:11",
         "parentId" : "0",
         "groupName" : "comment",
         "updated" : "2010-10-10T12:00:00",
         "id" : "12",
         "ownerId" : "sb.mbga.jp:0"
      }
   ],
   "startIndex" : 1,
   "sorted" : true,
   "itemsPerPage" : 2,
   "totalResults" : 12,
   "filtered" : false
}

If you specify a non-existent groupName, you will receive 404 Not Found.

GET /social/api/restful/v2/textdata/@app/unknown/@all
Host: sb.sp.mbga-platform.jp

HTTP/1.0 404 Not Found

{
   "Error" : {
      "Code" : "404",
      "Message" : "Not Found"
   }
}
retrieve TextData entry

Retrieve a TextData entry by specifying fields.

GET /social/api/restful/v2/textdata/@app/comment/@all/10?fields=data,writerId,status
Host: sp.sb.mobage-platform.kr

HTTP/1.1 200 OK

{
   "writerId" : "sb.mbga.jp:12345",
   "status" : 0,
   "data" : "comment01"
}

If you specify a non-existent textdataId, you will receive 404 Not Found.

GET /social/api/restful/v2/textdata/@app/unknown/@all/9999
Host: sb.sp.mbga-platform.jp

HTTP/1.0 404 Not Found

{
   "Error" : {
      "Code" : "404",
      "Message" : "Not Found"
   }
}
retrieve TextData entries by specifying multiple TextData.id
GET /social/api/restful/v2/textdata/@app/comment/@all/10,20?fields=data,writerId,status,id
Host: sb.sp.mbga-platform.jp

HTTP/1.1 200 OK

{
   "entry" : [
      {
         "status" : 0,
         "data" : "comment01",
         "writerId" : "sb.mbga.jp:12345",
         "id" : "10",
      },
      {
         "status" : 21,
         "data" : "comment02",
         "writerId" : "sb.mbga.jp:23456",
         "id" : "12",
      }
   ],
   "startIndex" : 1,
   "sorted" : false,
   "itemsPerPage" : 50,
   "totalResults" : 2,
   "filtered" : false
}

textdata.update

Update the specified TextData entry.

API Definition

REST Base URI

http://sp.mbga-platform.jp/social/api/restful/v2 ( Service )
http://sb.sp.mbga-platform.jp/social/api/restful/v2 ( Sandbox )

REST HTTP Method

PUT

REST URI Fragment

/textdata/{appId}/{textdataGroupName}/{groupId}{-prefix|/|textdataId}

REST Query Parameters

Update-TextData-Request-Parameters

Return Object

none

 

 

Authorization

type

permission

description

ANONYMOUS

false

access without authentication

SECURITY_TOKEN

false

access with a security token

OAUTH_MOBILE

false

access with OAuth Token issued for Mobile

OAUTH_CONSUMER

true

access with an authentication by Consumer Request

RESTful API Response Code

HTTP Status Code

HTTP Status Message

JSON-RPC Error Codes

Meaning

202

Accepted

successful in updating a data

400

Bad Request

-32700, -32600, -32601, -32602, 400

illegal request data from the client

401

Unauthorized

401

authentication error

403

Forbidden

403

the resource exists, but unable to access for a reason other than authentication error

404

Not Found

404

the resource doesn't exist

405

Method Not Allowed

405

you are not allowed to perform the method

500

Internal Server Error

-32603

an error occured in the API server

503

Service Unavailable

API service is temporary unavailable

 

JSON-RPC Error Code

An error value identifying the error type, contained in the "code" field of the Error object.

RPC Code

Meaning

-32700 (Parse error)

illegal JSON format

-32600 (Invalid Request)

illegal JSON-RPC request

-32601 (Method not found)

the method doesn't exist nor is available

-32602 (Invalid params)

illegal API request parameters

-32603 (Internal server error)

an error occured in the API server

400 (Bad Request)

illegal request from the client for a reason other than the other errors

401 (Unauthorized)

authentication error

403 (Forbidden)

the resource exists, but unable to access for a reason other than authentication error

404 (Not Found)

the resource doesn't exist

405 (Method Not Allowed)

you are not allowed to perform the method

Data Types

Update-TextData-Request-Parameters

Specify appId, groupId, and textdataGroupName as URI Template Parameters, and then specify the other parameters as Query String.

Name

Type

Description

appId

AppId

Required '@app' only

groupId

GroupId

Required '@all' only

textdataGroupName

String

the name of the TextDataGroup

 

  • Base Data Type
    • Starndard-Request-Parameters
Starndard-Request-Parameters

The following fields are supported.

Name

Type

Description

format

String

Optional 'json' only

See 6.1 Standard Request Parameters - OpenSocial Core API Server Specification for more details.

TextData

Name

Type

Description

data

String

a text data

parentId

String

the id of the parent TextData object

ownerId

String

the UserId of the owner

 

Note

  • The size of a data is up to 2048 bytes.
  • If you create or update an user entry, you are required to specify TextData#writerId in the entry.

 

 

 

 

Sample Data

RESTful API

update TextData entry
PUT /social/api/restful/v2/textdata/@app/comment/@all/20
Host: sb.sp.mbga-platform.jp

{ "data": "You got Lv30!" }

HTTP/1.1 202 Accepted
  • If you post a data that contains profanity, then you will receive 400 Bad Request.
  • If you specify a non-existent textdataId, you will receive 404 Not Found.

textdata.delete

Delete TextData entry.

API Definition

REST Base URI

http://sp.mbga-platform.jp/social/api/restful/v2 ( Service )
http://sb.sp.mbga-platform.jp/social/api/restful/v2 ( Sandbox )

REST HTTP Method

DELETE

REST URI Fragment

/textdata/{appId}/{textdataGroupName}/{groupId}{-prefix|/|textdataId}

REST Query Parameters

Delete-TextData-Request-Parameters

Return Object

ObjectId

 

 

 

 

Authorization

type

permission

description

ANONYMOUS

false

access without authentication

SECURITY_TOKEN

false

access with a security token

OAUTH_MOBILE

false

access with OAuth Token issued for Mobile

OAUTH_CONSUMER

true

access with an authentication by Consumer Request

RESTful API Response Code

HTTP Status Code

HTTP Status Message

JSON-RPC Error Codes

Meaning

202

Accepted

successful in deleting a data

400

Bad Request

-32700, -32600, -32601, -32602, 400

illegal request data from the client

401

Unauthorized

401

authentication error

403

Forbidden

403

the resource exists, but unable to access for a reason other than authentication error

404

Not Found

404

the resource doesn't exist

405

Method Not Allowed

405

you are not allowed to perform the method

500

Internal Server Error

-32603

an error occured in the API server

503

Service Unavailable

API service is temporary unavailable

JSON-RPC Error Code

An error value identifying the error type, contained in the "code" field of the Error object.

RPC Code

Meaning

-32700 (Parse error)

illegal JSON format

-32600 (Invalid Request)

illegal JSON-RPC request

-32601 (Method not found)

the method doesn't exist nor is available

-32602 (Invalid params)

illegal API request parameters

-32603 (Internal server error)

an error occured in the API server

400 (Bad Request)

illegal request from the client for a reason other than the other errors

401 (Unauthorized)

authentication error

403 (Forbidden)

the resource exists, but unable to access for a reason other than authentication error

404 (Not Found)

the resource doesn't exist

405 (Method Not Allowed)

you are not allowed to perform the method

Data Type

Delete-TextData-Request-Parameters

Specify appId, groupId, and textdataGroupName as URI Template Parameters, and then specify the other parameters as Query String.

Name

Type

Description

appId

AppId

Required '@app' only

groupId

GroupId

Required '@all' only

textdataGroupName

String

the name of the TextDataGroup

 

  • Base Data Type
    • Starndard-Request-Parameters
Starndard-Request-Parameters

The following fields are supported.

Name

Type

Description

format

String

Optional 'json' only

 
See 6.1 Standard Request Parameters - OpenSocial Core API Server Specification for more details.
 

Note

  • If you request a deleted data by GET method, you will receive 404 Not Found.
  • If you request a data deleted by an operator, you will receive a response with the status set to 20.

 

 

 

 

Sample Data

RESTful API

delete TextData entry
DELETE /social/api/restful/v2/textdata/@app/comment/@all/20
Host: sb.sp.mbga-platform.jp

HTTP/1.1 202 Accepted

If you request a data that the textdataId has already been deleted, or a data that the textdataId doesn't exist, then you will receive 404 Not Found.

DELETE /social/api/restful/v2/textdata/@app/comment/@all/20
Host: sb.sp.mbga-platform.jp

HTTP/1.1 404 Not Found

{
   "Error" : {
      "Code" : "404",
      "Message" : "Not Found"
   }
}

 

 

 

 

OpenSocial Core API Server Specification 1.0
OpenSocial Core Data Specification 1.0
OpenSocial Social API Server Specification 1.0
OpenSocial Social Data Specification 1.0

 

 

 

 

Revision History

  • 06/05/2014
    • Spec change about users who have no birthdate registered.
  • 08/13/2013, 08/23/2013
    • Spec change about users who have no birthdate registered.
  • 03/01/2013
    • document migration

 

 

PREVIOUS

TextData

NEXT

About TextData API