TextData
textdatagroup.create
This is an API for creating a TextDataGroup.
API definitions
| REST Base URI | http://app.mbga-platform.jp/social/api/restful/v2 ( Service ) http://app.sb.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 |
Approval
| type | permission | description |
|---|---|---|
| ANONYMOUS | false | Unauthorized access |
| SECURITY_TOKEN | false | Authorization using a security token |
| OAUTH_MOBILE | false | Authorization using an OAuth Token issued for a mobile device |
| OAUTH_CONSUMER | true | Authorization using a Consumer Request |
RESTful API response codes
| HTTP Status Code | HTTP Status Message | JSON-RPC Error Codes | Meaning |
|---|---|---|---|
| 201 | Created | – | Data successfully created. |
| 400 | Bad Request | -32700, -32600, -32601, -32602, 400 | Corrupt request data on the client side |
| 401 | Unauthorized | 401 | Authorization error |
| 403 | Forbidden | 403 | The resource exists, but access is not possible due to a reason other than an authorization error |
| 404 | Not Found | 404 | The resource doesn’t exist |
| 405 | Method Not Allowed | 405 | That operation is not allowed |
| 500 | Internal Server Error | -32603 | An error on the API server side |
| 503 | Service Unavailable | – | The API cannot be used temporarily |
JSON-RPC error codes
These are values are included in the code field of the Error object when an error has occurred.
| RPC Code | Meaning |
|---|---|
| -32700 (Parse error) | Invalid JSON format |
| -32600 (Invalid Request) | Invalid JSON-RPC request |
| -32601 (Method not found) | The method either doesn’t exist or is an unusable method |
| -32602 (Invalid params) | Invalid API request parameters |
| -32603 (Internal server error) | An error on the API server side |
| 400 (Bad Request) | A bad request on the client side that does not correspond to any other error |
| 401 (Unauthorized) | Authorization error |
| 403 (Forbidden) | The resource exists, but access is not possible due to a reason other than an authorization error |
| 404 (Not Found) | The resource doesn’t exist |
| 405 (Method Not Allowed) | That operation is not allowed |
Data types
Create-TextDataGroup-Request-Parameters
appId and groupId are specified as URI Template Parameters, and all other parameters are specified as Query String.
| Name | Type | Description |
|---|---|---|
| appId | AppId | Required Only '@app' is specifiable. |
| groupId | GroupId | Required Only '@all' is specifiable. |
Base data types
- Starndard-Request-Parameters
TextdataGroup
| Name | Type | Description |
|---|---|---|
| name | String | This is the name of the TextDataGroup to be created. |
| parentId | String | This is the id value for indicating the ownership. |
Name field
Only alphanumerical characters and underscores can be used.Up to a maximum of 32 bytes can be assigned.
parentId field
parentId are such that the id value of the parent is input from the perspective of the child so that the parent-child relationship is apparent. Please be sure to input this if the data structure has a parent-child relationship, since it is necessary for monitoring.
Restrictions
- Five TextDataGroups can be created per application.
Sample data
RESTful API
Create a new TextDataGroup
POST /social/api/restful/v2/textdata/@app/@all
{ "name": "diary" }
HTTP/1.1 201 Created
A Bad Request will result if the TextDataGroup you are trying to create already exists, or the TextDataGroup has reached the upper limit.
POST /social/api/restful/v2/textdata/@app/@all
{ "name": "diary" }
HTTP/1.1 400 Bad Request
{
"Error" : {
"Code" : "400",
"Message" : "Bad Request"
}
}
textdatagroup.get
This is an API for acquiring TextDataGroup information.
API definitions
| REST Base URI | http://app.mbga-platform.jp/social/api/restful/v2 ( Service ) http://app.sb.mbga-platform.jp/social/api/restful/v2 ( Sandbox ) |
| REST HTTP Method | GET |
| REST URI Fragment | /textdata/{appId}/{groupId} ``` /textdata/{appId}/{textdataGroupName}{-prefix |
| REST Query Parameters | Get-TextDataGroup-Request-Parameters |
| Return Object | TextDataGroup Collection |
認可
| type | permission | description |
|---|---|---|
| ANONYMOUS | false | Unauthorized access |
| SECURITY_TOKEN | false | Authorization using a security token |
| OAUTH_MOBILE | false | Authorization using an OAuth Token issued for a mobile device |
| OAUTH_CONSUMER | true | Authorization using a Consumer Request |
RESTful API response codes
| HTTP Status Code | HTTP Status Message | JSON-RPC Error Codes | Meaning |
|---|---|---|---|
| 200 | OK | – | Data successfully acquired |
| 400 | Bad Request | -32700, -32600, -32601, -32602, 400 | Corrupt request data on the client side |
| 401 | Unauthorized | 401 | Authorization error |
| 403 | Forbidden | 403 | The resource exists, but access is not possible due to a reason other than an authorization error |
| 404 | Not Found | 404 | The resource doesn’t exist |
| 405 | Method Not Allowed | 405 | That operation is not allowed |
| 500 | Internal Server Error | -32603 | An error on the API server side |
| 503 | Service Unavailable | – | The API cannot be used temporarily |
JSON-RPC error codes
These are values are included in the code field of the Error object when an error has occurred.
| RPC Code | Meaning |
|---|---|
| -32700 (Parse error) | Invalid JSON format |
| -32600 (Invalid Request) | Invalid JSON-RPC request |
| -32601 (Method not found) | The method either doesn’t exist or is an unusable method |
| -32602 (Invalid params) | Invalid API request parameters |
| -32603 (Internal server error) | An error on the API server side |
| 400 (Bad Request) | A bad request on the client side that does not correspond to any other error |
| 401 (Unauthorized) | Authorization error |
| 403 (Forbidden) | The resource exists, but access is not possible due to a reason other than an authorization error |
| 404 (Not Found) | The resource doesn’t exist |
| 405 (Method Not Allowed) | That operation is not allowed |
Data types
Get-TextDataGroup-Request-Parameters
appId, groupId and textdataGroupName are specified as URI Template Parameters, and all other parameters are specified as Query String.
| Name | Type | Description |
|---|---|---|
| appId | AppId | Required Only '@app' is specifiable. |
| groupId | GroupId | Required Only '@all' is specifiable. |
| textdataGroupName | String | This is the name of the TextDataGroup. |
Base data types
- Standard-Request-Parameters
- Collection-Request-Parameters
Starndard-Request-Parameters
The following is a list of the supported fields.
| Name | Type | Description |
|---|---|---|
| format | String | Optional Only 'json' is specifiable. |
See 6.1 Standard Request Parameters - OpenSocial Core API Server Specification for details.
Collection-Request-Parameters
The following is a list of the supported fields.
| Name | Type | Description |
|---|---|---|
| count | Number | Optional, An integer between 1 and 1000. The default value is 50. |
| startIndex | Number | Optional, An integer of 1 or greater |
See 6.2 Collection Request Parameters - OpenSocial Core API Server Specification for details.
TextDataGroup
| Name | Type | Description |
|---|---|---|
| id | String | The ID of the TextDataGroup object |
| name | String | Name of the TextDataGroup object |
| appId | String | The id of the application |
| parentId | String | ID of the parent TextDataGroup object |
Sample data
RESTful API
In the event of acquiring a TextDataGroup collection
GET /social/api/restful/v2/textdata/@app/@all
Host: app.sb.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
}
Acquire specific TextDataGroup information
GET /social/api/restful/v2/textdata/@app/diary/@self
Host: app.sb.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
This is an API for deleting a TextDataGroup entry.
API definitions
| REST Base URI | http://app.mbga-platform.jp/social/api/restful/v2 ( Service ) http://app.sb.mbga-platform.jp/social/api/restful/v2 ( Sandbox ) |
| REST HTTP Method | DELETE |
| REST URI Fragment | ``` /textdata/{appId}/{textdataGroupName}{-prefix |
| REST Query Parameters | Delete-TextDataGroup-Request-Parameters |
| Return Object | Objecd-Id |
Approval
| type | permission | description |
|---|---|---|
| ANONYMOUS | false | Unauthorized access |
| SECURITY_TOKEN | false | Authorization using a security token |
| OAUTH_MOBILE | false | Authorization using an OAuth Token issued for a mobile device |
| OAUTH_CONSUMER | true | Authorization using a Consumer Request |
RESTful API response codes
| HTTP Status Code | HTTP Status Message | JSON-RPC Error Codes | Meaning |
|---|---|---|---|
| 201 | Accepted | – | Data successfully deleted. |
| 400 | Bad Request | -32700, -32600, -32601, -32602, 400 | Corrupt request data on the client side |
| 401 | Unauthorized | 401 | Authorization error |
| 403 | Forbidden | 403 | The resource exists, but access is not possible due to a reason other than an authorization error |
| 404 | Not Found | 404 | The resource doesn’t exist |
| 405 | Method Not Allowed | 405 | That operation is not allowed |
| 500 | Internal Server Error | -32603 | An error on the API server side |
| 503 | Service Unavailable | – | The API cannot be used temporarily |
JSON-RPC error codes
These are values are included in the code field of the Error object when an error has occurred.
| RPC Code | Meaning |
|---|---|
| -32700 (Parse error) | Invalid JSON format |
| -32600 (Invalid Request) | Invalid JSON-RPC request |
| -32601 (Method not found) | The method either doesn’t exist or is an unusable method |
| -32602 (Invalid params) | Invalid API request parameters |
| -32603 (Internal server error) | An error on the API server side |
| 400 (Bad Request) | A bad request on the client side that does not correspond to any other error |
| 401 (Unauthorized) | Authorization error |
| 403 (Forbidden) | The resource exists, but access is not possible due to a reason other than an authorization error |
| 404 (Not Found) | The resource doesn’t exist |
| 405 (Method Not Allowed) | That operation is not allowed |
Data types
Delete-TextDataGroup-Request-Parameters
appId, groupId and textdataGroupName are specified as URI Template Parameters, and all other parameters are specified as Query String.
| Name | Type | Description |
|---|---|---|
| appId | AppId | Required Only '@app' is specifiable. |
| groupId | GroupId | Required Only '@self' is specifiable. |
| textdataGroupName | String | This is the name of the TextDataGroup |
Base data types
- Standard-Request-Parameters
Starndard-Request-Parameters
The following is a list of the supported fields.
| Name | Type | Description |
|---|---|---|
| format | String | Optional Only 'json' is specifiable. |
See 6.1 Standard Request Parameters - OpenSocial Core API Server Specification for details.
Sample data
RESTful API
Delete a TextDataGroup entry
DELETE /social/api/restful/v2/textdata/@app/diary/@self
Host: app.sb.mbga-platform.jp
HTTP/1.1 202 Accepted
"1"
textdata.create
This is an API for creating a TextData entry.
API definitions
| REST Base URI | http://app.mbga-platform.jp/social/api/restful/v2 ( Service ) http://app.sb.mbga-platform.jp/social/api/restful/v2 ( Sandbox ) |
| REST HTTP Method | POST |
| REST URI Fragment | ``` /textdata/{appId}/{textdataGroupName}{-prefix |
| REST Query Parameters | Create-TextData-Request-Parameters |
| Return Object | TextData |
Approval
| type | permission | description |
|---|---|---|
| ANONYMOUS | false | Unauthorized access |
| SECURITY_TOKEN | false | Authorization using a security token |
| OAUTH_MOBILE | false | Authorization using an OAuth Token issued for a mobile device |
| OAUTH_CONSUMER | true | Authorization using a Consumer Request |
RESTful API response codes
| HTTP Status Code | HTTP Status Message | JSON-RPC Error Codes | Meaning |
|---|---|---|---|
| 201 | Created | – | Data successfully created. |
| 400 | Bad Request | -32700, -32600, -32601, -32602, 400 | Corrupt request data on the client side |
| 401 | Unauthorized | 401 | Authorization error |
| 403 | Forbidden | 403 | The resource exists, but access is not possible due to a reason other than an authorization error |
| 404 | Not Found | 404 | The resource doesn’t exist |
| 405 | Method Not Allowed | 405 | That operation is not allowed |
| 500 | Internal Server Error | -32603 | An error on the API server side |
| 503 | Service Unavailable | – | The API cannot be used temporarily |
JSON-RPC error codes
These are values are included in the code field of the Error object when an error has occurred.
| RPC Code | Meaning |
|---|---|
| -32700 (Parse error) | Invalid JSON format |
| -32600 (Invalid Request) | Invalid JSON-RPC request |
| -32601 (Method not found) | The method either doesn’t exist or is an unusable method |
| -32602 (Invalid params) | Invalid API request parameters |
| -32603 (Internal server error) | An error on the API server side |
| 400 (Bad Request) | A bad request on the client side that does not correspond to any other error |
| 401 (Unauthorized) | Authorization error |
| 403 (Forbidden) | The resource exists, but access is not possible due to a reason other than an authorization error |
| 404 (Not Found) | The resource doesn’t exist |
| 405 (Method Not Allowed) | That operation is not allowed |
Data types
Create-TextData-Request-Parameters
appId, groupId and textdataGroupName are specified as URI Template Parameters, and all other parameters are specified as Query String.
| Name | Type | Description |
|---|---|---|
| appId | AppId | Required Only '@app' is specifiable. |
| groupId | GroupId | Required Only '@all' is specifiable. |
| textdataGroupName | String | This is the name of the TextDataGroup |
Base data types
- Starndard-Request-Parameters
Starndard-Request-Parameters
The following is a list of the supported fields.
| Name | Type | Description |
|---|---|---|
| format | String | Optional Only 'json' is specifiable. |
See 6.1 Standard Request Parameters - OpenSocial Core API Server Specification for details.
TextData
| Name | Type | Description |
|---|---|---|
| data | String | TextData |
| parentId | String | ID of the parent TextData object |
| writerId | String | The userId of the person who wrote the data |
| ownerId | String | The userId of the owner of the data |
Precautions
- The size of the data is restricted to 2048 bytes.
- parentId are such that the id value of the parent is input from the perspective of the child so that the parent-child relationship is apparent. Please be sure to input this if the data structure has a parent-child relationship, since it is necessary for monitoring.
- Input a string that can be seen as a sentence in the data field. Please note that if it cannot be recognized, it may be deleted by the operator.
- If the data field contains any prohibited words that violate Mobage’s operations policy, a 400 Bad Request will be returned if you attempt to add or update the TextData entry.
- For an entry in Trusted Mode, please be sure to set the TextData#ownerId. TextData#ownerId is a field that was prepared to indicate the original owner, or the owner of the parent data.
- For example, when an arbitrary user writes on the message board that was assigned to each user, the owner is the user to whom the message board was assigned to, so the owner's ID is set in TextData#ownerId.
- If the entry is not intended for the owner, please set the application ID in TextData#ownerId.
- Please be sure to set TextData#writerId when an entry is created or updated by the user. If TextData#writerId is not set, it will automatically be set to 0, indicating that the entry was controlled by a partner.
- If the user in TextData#writerId has blacklisted a viewer, please use the BlackList API to disable entries from being made.
Restrictions
- The maximum number of entries that can be stored in each TextDataGroup is 100,000 for up to 10,000 users who installed the application.
-
- If more than 10,000 users have installed the application up to the previous day, the maximum number of entries is 10 times the number of users who installed the application according to the count up to the previous day.
-
Sample data
RESTful API
Create a TextData entry
This is an example in which user 10012 commented on user 10009's message board, which is set up in the game's My Page.
POST /social/api/restful/v2/textdata/@app/comment/@all
Host: app.sb.mbga-platform.jp
{
"data": "I also play the Bandid Nation.",
"writerId": "10012",
"ownerId": "10009"
}
HTTP/1.1 201 Created
{
"status" : 0,
"data" : "I also play the Bandid Nation.",
"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 data to be posted contains a banned word, 400 Bad Request is returned.
POST /social/api/restful/v2/textdata/@app/comment/@all
Host: app.sb.mbga-platform.jp
{ "data": "If words such as "kill" are posted on a message board or elsewhere, the management team may delete these words." }
HTTP/1.1 400 Bad Reqeut
{
"Error" : {
"Code" : "400",
"Message" : "Bad Request"
}
}
textdata.get
This is an API for acquiring a TextData entry.
API definitions
| REST Base URI | http://app.mbga-platform.jp/social/api/restful/v2 ( Service ) http://app.sb.mbga-platform.jp/social/api/restful/v2 ( Sandbox ) |
| REST HTTP Method | GET |
| REST URI Fragment | ``` /textdata/{appId}/{textdataGroupName}{-prefix |
| REST Query Parameters | Get-TextData-Request-Parameters |
| Return Object | TextData Collection |
Approval
| type | permission | description |
|---|---|---|
| ANONYMOUS | false | Unauthorized access |
| SECURITY_TOKEN | false | Authorization using a security token |
| OAUTH_MOBILE | false | Authorization using an OAuth Token issued for a mobile device |
| OAUTH_CONSUMER | true | Authorization using a Consumer Request |
RESTful API response codes
| HTTP Status Code | HTTP Status Message | JSON-RPC Error Codes | Meaning |
|---|---|---|---|
| 200 | OK | – | Data successfully acquired |
| 400 | Bad Request | -32700, -32600, -32601, -32602, 400 | Corrupt request data on the client side |
| 401 | Unauthorized | 401 | Authorization error |
| 403 | Forbidden | 403 | The resource exists, but access is not possible due to a reason other than an authorization error |
| 404 | Not Found | 404 | The resource doesn’t exist |
| 405 | Method Not Allowed | 405 | That operation is not allowed |
| 500 | Internal Server Error | -32603 | An error on the API server side |
| 503 | Service Unavailable | – | The API cannot be used temporarily |
JSON-RPC error codes
These are values are included in the code field of the Error object when an error has occurred.
| RPC Code | Meaning |
|---|---|
| -32700 (Parse error) | Invalid JSON format |
| -32600 (Invalid Request) | Invalid JSON-RPC request |
| -32601 (Method not found) | The method either doesn’t exist or is an unusable method |
| -32602 (Invalid params) | Invalid API request parameters |
| -32603 (Internal server error) | An error on the API server side |
| 400 (Bad Request) | A bad request on the client side that does not correspond to any other error |
| 401 (Unauthorized) | Authorization error |
| 403 (Forbidden) | The resource exists, but access is not possible due to a reason other than an authorization error |
| 404 (Not Found) | The resource doesn’t exist |
| 405 (Method Not Allowed) | That operation is not allowed |
Data types
Get-TextData-Request-Parameters
appId, groupId and textdataGroupName are specified as URI Template Parameters, and all other parameters are specified as Query String.
| Name | Type | Description |
|---|---|---|
| appId | AppId | Required Only '@app' is specifiable. |
| groupId | GroupId | Required Only '@all' is specifiable. |
| textdataGroupName | String | This is the name of the TextDataGroup |
| fields | Array | Optional |
Base data types
- Starndard-Request-Parameters
- Collection-Request-Parameters
Starndard-Request-Parameters
The following is a list of the supported fields.
| Name | Type | Description |
|---|---|---|
| format | String | Optional Only 'json' is specifiable. |
See 6.1 Standard Request Parameters - OpenSocial Core API Server Specification for details.
Collection-Request-Parameters
The following is a list of the supported fields.
| Name | Type | Description |
|---|---|---|
| filterBy | String or Array | Optional, The specifiable fields are 'ownerId' and 'writerId' |
| filterOp | String or Array | Optional, equals is the only specifiable operator |
| filterValue | String or Array | Optional, It is required if filterBy has been assigned. |
| count | Number | Optional, An integer between 1 and 1000. The default value is 50. |
| sortBy | String | Optional, The specifiable fields are 'id' or 'updated' |
| sortOrder | String | Optional, 'ascending' or 'descending' |
| startIndex | Number | Optional, An integer of 1 or greater |
See 6.2 Collection Request Parameters - OpenSocial Core API Server Specification for 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 person who wrote the data |
| ownerId | String | The userId of the owner of the data |
| data | String | The text data |
| status | Number | The logical status value |
| published | DateTime | Date published |
| updated | DateTime | Date updated |
Status field
| status | Description |
|---|---|
| 0 | Normal |
| 11 | Modified by user |
| 21 | Modified by operator |
| 31 | Modified by partner |
Precautions
- A time zone specifier is not included in the dateTime format contained in the response from the API. Therefore, the time is displayed in GMT (Greenwich Mean Time).
- Please only specify ids within the same group for a GET in which multiple id are specified. ids belonging to different groups cannot be acquired.
Sample data
RESTful API
Acquire a TextData collection
This is an example of writerId sorting the TextData list belonging to a comment from the smallest to the largest, and then acquiring 2 entries at a time.
GET /social/api/restful/v2/textdata/@app/comment/@all?sortBy=writerId&sortOrder=ascending&count=2
Host: app.sb.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 a groupName that does not exist is assigned, 404 Not Found is returned.
GET /social/api/restful/v2/textdata/@app/unknown/@all
Host: app.sb.mbga-platform.jp
HTTP/1.0 404 Not Found
{
"Error" : {
"Code" : "404",
"Message" : "Not Found"
}
}
Acquire a TextData entry
This is an example of an acquisition through assigning a field.
GET /social/api/restful/v2/textdata/@app/comment/@all/10?fields=data,writerId,status
Host: app.sb.mbga-platform.jp
HTTP/1.1 200 OK
{
"writerId" : "sb.mbga.jp:12345",
"status" : 0,
"data" : "comment01"
}
If a textdataId that does not exist is assigned, 404 Not Found is returned.
GET /social/api/restful/v2/textdata/@app/unknown/@all/9999
Host: app.sb.mbga-platform.jp
HTTP/1.0 404 Not Found
{
"Error" : {
"Code" : "404",
"Message" : "Not Found"
}
}
Acquiring a TextData entry by assigning multiple TextData.id
GET /social/api/restful/v2/textdata/@app/comment/@all/10,20?fields=data,writerId,status,id
Host: app.sb.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
This is an API for updating TextData entries.
API definitions
| REST Base URI | http://app.mbga-platform.jp/social/api/restful/v2 ( Service ) http://app.sb.mbga-platform.jp/social/api/restful/v2 ( Sandbox ) |
| REST HTTP Method | PUT |
| REST URI Fragment | ``` /textdata/{appId}/{textdataGroupName}/{groupId}{-prefix |
| REST Query Parameters | Update-TextData-Request-Parameters |
| Return Object | None |
Approval
| type | permission | description |
|---|---|---|
| ANONYMOUS | false | Unauthorized access |
| SECURITY_TOKEN | false | Authorization using a security token |
| OAUTH_MOBILE | false | Authorization using an OAuth Token issued for a mobile device |
| OAUTH_CONSUMER | true | Authorization using a Consumer Request |
RESTful API response codes
| HTTP Status Code | HTTP Status Message | JSON-RPC Error Codes | Meaning |
|---|---|---|---|
| 202 | Accepted | – | Data successfully updated. |
| 400 | Bad Request | -32700, -32600, -32601, -32602, 400 | Corrupt request data on the client side |
| 401 | Unauthorized | 401 | Authorization error |
| 403 | Forbidden | 403 | The resource exists, but access is not possible due to a reason other than an authorization error |
| 404 | Not Found | 404 | The resource doesn’t exist |
| 405 | Method Not Allowed | 405 | That operation is not allowed |
| 500 | Internal Server Error | -32603 | An error on the API server side |
| 503 | Service Unavailable | – | The API cannot be used temporarily |
JSON-RPC error codes
These are values are included in the code field of the Error object when an error has occurred.
| RPC Code | Meaning |
|---|---|
| -32700 (Parse error) | Invalid JSON format |
| -32600 (Invalid Request) | Invalid JSON-RPC request |
| -32601 (Method not found) | The method either doesn’t exist or is an unusable method |
| -32602 (Invalid params) | Invalid API request parameters |
| -32603 (Internal server error) | An error on the API server side |
| 400 (Bad Request) | A bad request on the client side that does not correspond to any other error |
| 401 (Unauthorized) | Authorization error |
| 403 (Forbidden) | The resource exists, but access is not possible due to a reason other than an authorization error |
| 404 (Not Found) | The resource doesn’t exist |
| 405 (Method Not Allowed) | That operation is not allowed |
Data types
Update-TextData-Request-Parameters
appId, groupId and textdataGroupName are specified as URI Template Parameters, and all other parameters are specified as Query String.
| Name | Type | Description |
|---|---|---|
| appId | AppId | Required Only '@app' is specifiable. |
| groupId | GroupId | Required Only '@all' is specifiable. |
| textdataGroupName | String | This is the name of the TextDataGroup |
Base data types
- Starndard-Request-Parameters
Starndard-Request-Parameters
The following is a list of the supported fields.
| Name | Type | Description |
|---|---|---|
| format | String | Optional Only 'json' is specifiable. |
See 6.1 Standard Request Parameters - OpenSocial Core API Server Specification for details.
TextData
| Name | Type | Description |
|---|---|---|
| data | String | The text data |
| parentId | String | ID of the parent TextData object |
| ownerId | String | The userId of the owner of the data |
Precautions
- The data size is up to 2048 bytes.
Sample data
RESTful API
Update a TextData entry
PUT /social/api/restful/v2/textdata/@app/comment/@all/20
Host: app.sb.mbga-platform.jp
{ "data": "You are now level 30!" }
HTTP/1.1 202 Accepted
- If the data to be posted contains a banned word, 400 Bad Request is returned.
- If a groupName that does not exist is assigned, 404 Not Found is returned.
textdata.delete
This is an API for deleting TextData entries.
API definitions
| REST Base URI | http://app.mbga-platform.jp/social/api/restful/v2 ( Service ) http://app.sb.mbga-platform.jp/social/api/restful/v2 ( Sandbox ) |
| REST HTTP Method | DELETE |
| REST URI Fragment | ``` /textdata/{appId}/{textdataGroupName}/{groupId}{-prefix |
| REST Query Parameters | Delete-TextData-Request-Parameters |
| Return Object | ObjectId |
Approval
| type | permission | description |
|---|---|---|
| ANONYMOUS | false | Unauthorized access |
| SECURITY_TOKEN | false | Authorization using a security token |
| OAUTH_MOBILE | false | Authorization using an OAuth Token issued for a mobile device |
| OAUTH_CONSUMER | true | Authorization using a Consumer Request |
RESTful API response codes
| HTTP Status Code | HTTP Status Message | JSON-RPC Error Codes | Meaning |
|---|---|---|---|
| 202 | Accepted | – | Data successfully deleted. |
| 400 | Bad Request | -32700, -32600, -32601, -32602, 400 | Corrupt request data on the client side |
| 401 | Unauthorized | 401 | Authorization error |
| 403 | Forbidden | 403 | The resource exists, but access is not possible due to a reason other than an authorization error |
| 404 | Not Found | 404 | The resource doesn’t exist |
| 405 | Method Not Allowed | 405 | That operation is not allowed |
| 500 | Internal Server Error | -32603 | An error on the API server side |
| 503 | Service Unavailable | – | The API cannot be used temporarily |
JSON-RPC error codes
These are values are included in the code field of the Error object when an error has occurred.
| RPC Code | Meaning |
|---|---|
| -32700 (Parse error) | Invalid JSON format |
| -32600 (Invalid Request) | Invalid JSON-RPC request |
| -32601 (Method not found) | The method either doesn’t exist or is an unusable method |
| -32602 (Invalid params) | Invalid API request parameters |
| -32603 (Internal server error) | An error on the API server side |
| 400 (Bad Request) | A bad request on the client side that does not correspond to any other error |
| 401 (Unauthorized) | Authorization error |
| 403 (Forbidden) | The resource exists, but access is not possible due to a reason other than an authorization error |
| 404 (Not Found) | The resource doesn’t exist |
| 405 (Method Not Allowed) | That operation is not allowed |
Data types
Delete-TextData-Request-Parameters
appId, groupId and textdataGroupName are specified as URI Template Parameters, and all other parameters are specified as Query String.
| Name | Type | Description |
|---|---|---|
| appId | AppId | Required Only '@app' is specifiable. |
| groupId | GroupId | Required Only '@all' is specifiable. |
| textdataGroupName | String | This is the name of the TextDataGroup. |
Base data types
- Starndard-Request-Parameters
Starndard-Request-Parameters
The following is a list of the supported fields.
| Name | Type | Description |
|---|---|---|
| format | String | Optional Only 'json' is specifiable. |
See 6.1 Standard Request Parameters - OpenSocial Core API Server Specification for details.
Precautions
- If the data has been deleted, acquiring the entry source through GET will result in 404 Not Found.
- For the time being, it can be acquired with a status of 20 if it had been deleted by the operator.
Sample data
RESTful API
Deleting a TextData entry.
DELETE /social/api/restful/v2/textdata/@app/comment/@all/20
Host: app.sb.mbga-platform.jp
HTTP/1.1 202 Accepted
If a textdataId that has been deleted or a textdataId that does not exist is assigned, 404 Not Found is returned.
DELETE /social/api/restful/v2/textdata/@app/comment/@all/20
Host: app.sb.mbga-platform.jp
HTTP/1.1 404 Not Found
{
"Error" : {
"Code" : "404",
"Message" : "Not Found"
}
}
See Also
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/2012
- Deletion Status field It ”20:Deleted by operator” .
- 12/2010
- Initial Release.
- 11/24/2010
- Modified the textdatagroup.update method
- 11/09/2010
- Added Precautions for deletion by the operator
- 11/04/2010
- Once textdata.delete is executed, that entry can no longer be acquired through textdata.get
- 10/18/2010
- Modified the sample and Precautions for textdatagroup.create
- 10/06/2010
- Modified sb.dena.jp -> sb.mbga.jp