BlackList
blacklist.get
This acquires a list of users who are specified in a blacklist.
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 | ``` /blacklist/{userId}/{groupId}{-prefix |
| REST Query Parameters | Get-BlackList-Request-Parameters |
| Return Object | BlackList 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-BlackList-Request-Parameters
UserId, groupId and personId are specified as URI Template Parameters, and all other parameters are specified as Query String.
| Name | Type | Description |
|---|---|---|
| userId | UserId or Array | Required |
| groupId | GroupId | Required Only '@all' is specifiable. |
| personId | UserId or Array | Optional |
| fields | Array | Optional |
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 |
| sortBy | String | Optional, Only 'tergetId' is specifiable. |
| sortOrder | String | Optional, 'ascending' or 'descending' |
See 6.2 Collection Request Parameters - OpenSocial Core API Server Specification for details.
BlackList
| Name | Type | Description |
|---|---|---|
| id | UserId | A user who has added a targetId user to the blacklist |
| tergetId | UserId | A user who has been added to the blacklist by an id user |
Sample data
RESTful API
Acquires a list of blacklisted users.
GET /social/api/restful/v2/blacklist/1234/@all
Host: app.sb.mbga-platform.jp
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"entry" : [
{
"id" : "sb.mbga.jp:1234",
"tergetId": "sb.mbga.jp:5678",
},
{
"id" : "sb.mbga.jp:1234",
"tergetId": "sb.mbga.jp:6789",
},
],
"startIndex" : 1,
"itemsPerPage" : 50,
"totalResults" : 2
}
A blacklist check between two parties
GET /social/api/restful/v2/blacklist/1234/@all/5678
Host: app.sb.mbga-platform.jp
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id" : "sb.mbga.jp:1234",
"tergetId": "sb.mbga.jp:5678",
}
If a user specified in personId is not registered in the blacklist, 404 Not Found is returned.
GET /social/api/restful/v2/blacklist/1234/@all/9999
Host: app.sb.mbga-platform.jp
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8
{
"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
- 12/2010
- Initial Release.
- 10/06/2010
- Modified sb.dena.jp -> sb.mbga.jp