BlackList
Overview
The BlackList API is used to get specific users from the blacklist from among those who have installed the corresponding application.
BlackList Object Fields
Value |
Description |
Type |
Namespace |
Remark |
---|---|---|---|---|
id |
guid of the BlackList owner |
xs:string |
http://ns.dena.jp/mbga/gameapi/v1 | – |
appId |
ID of the application currently executing |
xs:int |
http://ns.dena.jp/mbga/gameapi/v1 | – |
targetId |
guid of a user who has been added to the BlackList |
xs:string |
http://ns.dena.jp/mbga/gameapi/v1 | – |
API Request
HTTP Methods
Proxy model
- GET
- Gets blacklist entry
- Gets blacklist collection
Trusted model
- GET
- Gets blacklist entry
- Gets blacklist collection
Endpoint URL
- Sandbox environment
http://sb.sp.app.mbga.jp/api/restful/v1/blacklist/{guid}/{selector}{-prefix|/|pid}
- Production environment
http://sp.app.mbga.jp/api/restful/v1/blacklist/{guid}/{selector}{-prefix|/|pid}
guid
Specify one of the following values for the guid parameter.
Value |
Description |
Remark |
---|---|---|
@me |
guid of the viewer |
Required |
{guid} |
User ID |
Required |
Before a valid Mobage user ID can be specified with the guid parameter, the user must have installed the associated application.
selector
Specify the following value for the selector parameter.
Value |
Description |
Remark |
---|---|---|
@all |
Represents the BlackList collection resource that contains users who have been added to the blacklist by the user specified in the guid parameter and who have installed the currently executing application |
Required |
pid
When selector is @all, you can specify the pid parameter.
Value |
Description |
Remark |
---|---|---|
{guid} |
guid of a user who was added to the blacklist by the user specified in the guid parameter |
Optional |
If you specify the pid parameter when requesting the entry resource and 200 OK is returned, it means that the designated user is in the blacklist. However, if 404 Not Found is returned, it means that the user is not in the blacklist.
Query Parameters
The following query parameters can be specified.
format
The response format is as shown below.
Value |
Description |
Remark |
---|---|---|
json |
"application/json; charset=utf8" |
Optional, default value |
fields
Here, you can specify attributes that you wish to obtain. For the fields that can be specified, please see the description of the BlackList object field.
To specify multiple fields, separate them with commas without any spaces in between.
If the fields parameter is omitted, all of the attribute information listed below is obtained.
In the interest of performance, you should only get the attributes that you need.
count
The count field enables you to specify the maximum number of entries in a collection resource that can be obtained in a response.
count can be a maximum of 1000, with a default value of 50.
startIndex
For startindex, specify the starting value of the collection resource. If startindex is omitted, 1 (the minimum value) is assumed.
API Response
Response Codes
The following is a list of the API response codes.
Request HTTP method |
Response code |
Response message |
Description |
---|---|---|---|
GET |
200 |
OK |
Successfully acquired the data |
GET |
400 |
Bad Request |
Invalid request data |
GET |
401 |
Unauthorized |
OAuth authorization failed |
GET |
403 |
Forbidden |
The user has not installed the application |
GET |
404 |
Not Found |
The user is not in the blacklist |
GET |
500 |
Internal Server Error |
Failed because of an API problem |
Notes
- If a user other than @me is specified for guid, the user must have installed the associated application.
- When using the Trusted model (Consumer Request), you cannot specify @me for guid. Doing so will result in a 400 Bad Request.
- guid must be a number, otherwise 400 will be returned for the response code.
- If the user has not installed the corresponding application, 403 will be returned for the response code.
Examples
Getting the BlackList Collection Registered by the Viewer
Request Format
GET /api/restful/v1/blacklist/@me/@all?format=json&fields=id,targetId&count=10&startIndex=1
Response Format
200 OK { "entry" : [ { "targetId" : "sb.sp.app.mbga.jp:10032", "id" : "sb.mbga.jp:10028" }, { "targetId" : "sb.sp.app.mbga.jp:10033", "id" : "sb.mbga.jp:10028" }, { "targetId" : "sb.sp.app.mbga.jp:10039", "id" : "sb.mbga.jp:10028" } ], "startIndex" : 1, "itemsPerPage" : 10, "totalResults" : 3 }
Checking the Blacklist Between Two People
Request Format
GET /api/restful/v1/blacklist/10028/@all/10045?format=json
Response Format
Since user 10028 has not registered user 10045 in the blacklist, 404 Not Found is returned. If user 10045 were registered in the blacklist, 200 OK would be returned.
404 Not Found
Reference Links
XML Schema Part 2: Datatypes Second Edition
URI Template draft-gregorio-uritemplate-03
Revision History
- 03/01/2013
- Initial release