Skip to main content

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​

ValueDescriptionTypeNamespaceRemark
idguid of the BlackList ownerxs:stringhttp://ns.dena.jp/mbga/gameapi/v1–
appIdID of the application currently executingxs:inthttp://ns.dena.jp/mbga/gameapi/v1–
targetIdguid of a user who has been added to the BlackListxs:stringhttp://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.

ValueDescriptionRemark
@meguid of the viewerRequired
{guid}User IDRequired

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.

ValueDescriptionRemark
@allRepresents 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 applicationRequired
pid​

When selector is @all, you can specify the pid parameter.

ValueDescriptionRemark
{guid}guid of a user who was added to the blacklist by the user specified in the guid parameterOptional

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.

ValueDescriptionRemark
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 methodResponse codeResponse messageDescription
GET200OKSuccessfully acquired the data
GET400Bad RequestInvalid request data
GET401UnauthorizedOAuth authorization failed
GET403ForbiddenThe user has not installed the application
GET404Not FoundThe user is not in the blacklist
GET500Internal Server ErrorFailed 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

XML Schema Part 2: Datatypes Second Edition
URI Template draft-gregorio-uritemplate-03

Revision History​

  • 03/01/2013
    • Initial release