Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

Document serial number: 000009952166 0=0=0=0=0=9=9=5=2=1=6=6=:c9bfab019f7e3ffc12bad043884264e6

66
Word Filter Web APIs Reference21
95
09
00
Document serial number: 000009952166

00

© 2014 Sony Computer Entertainment Inc.


All Rights Reserved.
SCE Confidential

Document serial number: 000009952166 0:0:0:0:0:9:9:5:2:1:6:6::c9bfab019f7e3ffc12bad043884264e6


Document serial number: 000009952166 0=0=0=0=0=9=9=5=2=1=6=6=:c9bfab019f7e3ffc12bad043884264e6

SCE CONFIDENTIAL

Table of Contents
Common Features ................................................................................................................................ 3
HTTP Status Codes ........................................................................................................................4
Errors ..................................................................................................................................................... 5
Error ................................................................................................................................................6
error .................................................................................................................................................7
Error Codes .....................................................................................................................................8
WordFilter APIs ................................................................................................................................... 10
POST CensorComment ................................................................................................................ 11
POST SanitizeComment ...............................................................................................................13

66
21
95
09
00
Document serial number: 000009952166

00

©SCEI

-2-

Document serial number: 000009952166 0:0:0:0:0:9:9:5:2:1:6:6::c9bfab019f7e3ffc12bad043884264e6


Document serial number: 000009952166 0=0=0=0=0=9=9=5=2=1=6=6=:c9bfab019f7e3ffc12bad043884264e6

SCE CONFIDENTIAL

66
Common Features 21
95
09
00
Document serial number: 000009952166

00

©SCEI

-3-

Document serial number: 000009952166 0:0:0:0:0:9:9:5:2:1:6:6::c9bfab019f7e3ffc12bad043884264e6


Document serial number: 000009952166 0=0=0=0=0=9=9=5=2=1=6=6=:c9bfab019f7e3ffc12bad043884264e6

SCE CONFIDENTIAL

HTTP Status Codes


HTTP status codes returned by the Word Filter Web APIs

Definition

Value Message Description


200 OK Success
400 Bad Request Incorrect request
401 Unauthorized No authentication information, etc.
403 Forbidden Request was refused
404 Not Found Specified resource does not exist, etc.
429 Too Many Requests Rate limit was exceeded
500 Internal Server Error Unexpected internal server error
Service Unavailable

66
503 Under maintenance, service has ended, etc.

Description

These are the HTTP status codes returned by the Word Filter Web APIs.

21
95
09
00
Document serial number: 000009952166

00

©SCEI

-4-

Document serial number: 000009952166 0:0:0:0:0:9:9:5:2:1:6:6::c9bfab019f7e3ffc12bad043884264e6


Document serial number: 000009952166 0=0=0=0=0=9=9=5=2=1=6=6=:c9bfab019f7e3ffc12bad043884264e6

SCE CONFIDENTIAL

66
Errors 21
95
09
00
Document serial number: 000009952166

00

©SCEI

-5-

Document serial number: 000009952166 0:0:0:0:0:9:9:5:2:1:6:6::c9bfab019f7e3ffc12bad043884264e6


Document serial number: 000009952166 0=0=0=0=0=9=9=5=2=1=6=6=:c9bfab019f7e3ffc12bad043884264e6

SCE CONFIDENTIAL

Error
Response body root object when errors occur

Definition

{
"error" : error object
}

Members
error Object that holds the error code and description

Description

66
This is the root object returned as the response body when an error occurs.

21
95
09
00
Document serial number: 000009952166

00

©SCEI

-6-

Document serial number: 000009952166 0:0:0:0:0:9:9:5:2:1:6:6::c9bfab019f7e3ffc12bad043884264e6


Document serial number: 000009952166 0=0=0=0=0=9=9=5=2=1=6=6=:c9bfab019f7e3ffc12bad043884264e6

SCE CONFIDENTIAL

error
Object indicating error content

Definition

{
"code" : Number,
"message" : String
}

Members
code Error code. The value range is 2166784-2170879.
message Error message (in English) for debugging. Up to 128 ASCII characters.

66
Description

This object indicates the error code and error message when an error occurs.

The message returned to message is for developers, so do not show it to users.

21
Methods for displaying error messages for users with the error code returned to code are available for
each product type; refer to the "PlayStation™Network Web APIs Overview" document for details.
95
09
00
Document serial number: 000009952166

00

©SCEI

-7-

Document serial number: 000009952166 0:0:0:0:0:9:9:5:2:1:6:6::c9bfab019f7e3ffc12bad043884264e6


Document serial number: 000009952166 0=0=0=0=0=9=9=5=2=1=6=6=:c9bfab019f7e3ffc12bad043884264e6

SCE CONFIDENTIAL

Error Codes
List of errors returned by the Word Filter Web APIs

Definition

Common errors for all APIs (request mistakes)


The following errors indicate that there was a mistake in the request issued by the client.
code message Description
2166785 Bad request Details are unknown, but an invalid value
was included in request (header, body, query
string, etc.)
2166786 Unsupported API version Unsupported API version

66
2166787 Too large body Request body is too long
2166788 Invalid NP environment Environment name is invalid
2167040 Invalid query string Details are unknown, but an value in query
string is invalid
2167041 Invalid parameter in query string Query parameter value in query string is
(parameter: 'parameter_name') invalid
2167042

2167043
Invalid parameter combination in
query string (parameters:
'parameter1', 'parameter2'…)
Cannot use query string
('parameter=value') for the
21 Query parameter combination in query
string is invalid

Specified query parameter cannot be used for


the specified resource
95
specified resource
2167044 Invalid parameter in URL Parameter section value included in URL is
(parameter: 'parameter_name') invalid
2167045 'parameter_name' parameter Query parameter required for query string
required in query string does not exist
Invalid header (header:
09

2167104 Header value for request header is invalid


'header_name')
2167105 'header_name' header required Header required for request header does not
exist
2167168 Invalid body Details are unknown, but request body value
is invalid
00

2167169 Null value not allowed (parameter: A member with a null value in request
'parameter_name') body exists
Document serial number: 000009952166

2167170 Invalid parameter in body Request body member value is invalid


(parameter: 'parameter_name')
2167171 Invalid number of elements Number of elements for request body array
00

(parameter: 'parameter_name') type members is invalid


2167172 Invalid parameter combination in Request body member combination is invalid
body (parameters: 'parameter1',
'parameter2'…)
2167174 'parameter_name' parameter Member required for request body does not
required in body exist

©SCEI

-8-

Document serial number: 000009952166 0:0:0:0:0:9:9:5:2:1:6:6::c9bfab019f7e3ffc12bad043884264e6


Document serial number: 000009952166 0=0=0=0=0=9=9=5=2=1=6=6=:c9bfab019f7e3ffc12bad043884264e6

SCE CONFIDENTIAL

Common errors for all APIs (authentication/authorization problems)


The following errors indicate that a resource could not be accessed due to the configuration for
authentication, authorization, etc.
code message Description
2167296 Access token required No access token
2167297 Invalid access token Access token is an invalid value or is
corrupted
2167298 Expired access token Access token is expired
2167302 Not authorized Not authorized to access specified resource or
use query parameter
2167303 Banned application Banned title
2167304 Banned user Banned user
2167305 Banned device Banned device
2167307 Rate limit exceeded API rate limit was exceeded

66
2167309 Not authorized access token Access token was obtained with an invalid
procedure
2167310 Needs to upgrade for PSN access Access was performed with an account that
has not been upgraded
2167424 Unknown client Client ID for access token is invalid

Common errors for all APIs (server problems)

2167552
message
Unexpected error
21
The following errors indicate that a server problem occurred.
code Description
Unexpected error
95
2167553 Internal server error Internal error of the server
2167554 Service temporarily unavailable Service has been temporarily stopped
2167555 Server busy Server overload
2167556 Authorization server error Authentication/authorization server error
2167616 Under maintenance Server is under maintenance
09

2167617 Service closed Service has closed


2167680 Unknown error Unknown error

Notes
00

Implement programming so that processing can continue even if an error code not in this document
returns.
Document serial number: 000009952166

00

©SCEI

-9-

Document serial number: 000009952166 0:0:0:0:0:9:9:5:2:1:6:6::c9bfab019f7e3ffc12bad043884264e6


Document serial number: 000009952166 0=0=0=0=0=9=9=5=2=1=6=6=:c9bfab019f7e3ffc12bad043884264e6

SCE CONFIDENTIAL

66
WordFilter APIs 21
95
09
00
Document serial number: 000009952166

00

©SCEI

- 10 -

Document serial number: 000009952166 0:0:0:0:0:9:9:5:2:1:6:6::c9bfab019f7e3ffc12bad043884264e6


Document serial number: 000009952166 0=0=0=0=0=9=9=5=2=1=6=6=:c9bfab019f7e3ffc12bad043884264e6

SCE CONFIDENTIAL

POST CensorComment
Check for inappropriate strings

Request

URI
POST WordFilterBaseUrl/v1/censorComment
• WordFilterBaseUrl
Specify the base URL for the Word Filter Web APIs group.

Query parameters
None

66
Header
Content-Type: application/json; charset=utf-8
Authorization: Bearer AccessToken
• AccessToken
Specify the access token.

Request body
{

}
"comment" : String
21
95
comment Target UTF-8 string to check for. Up to 1024 characters.

Response
09

Upon normal termination


Returns 200 for the HTTP status code, returns application/json for Content-Type for the header,
and returns a boolean type result value indicating whether the specified string was appropriate or
not for the response body.
If the specified comment does not include any inappropriate language, the result value will be true.
00

Upon error
Document serial number: 000009952166

The HTTP status code and response body that indicate one of the errors common to all APIs (refer to the
"Error Codes" section) will be returned.
00

Description

This API is for checking if a string input by a user contains inappropriate language or not. A UTF-8
encoded string is received and a boolean value that indicates whether the string is inappropriate or not
will return.

It is not necessary to check the strings in chat, etc. Check strings that will be seen by all players and will
remain for long periods of time. Note that the rules for language considered to be inappropriate may
change without notice.

©SCEI

- 11 -

Document serial number: 000009952166 0:0:0:0:0:9:9:5:2:1:6:6::c9bfab019f7e3ffc12bad043884264e6


Document serial number: 000009952166 0=0=0=0=0=9=9=5=2=1=6=6=:c9bfab019f7e3ffc12bad043884264e6

SCE CONFIDENTIAL

Use Restrictions

Platform Usable/Not Usable


PlayStation®4 application Not usable
PlayStation®3 application Not usable
PlayStation®Vita application Not usable
Companion application Usable
Application server/website Not usable

It is recommended that the frequency by which this API is called be kept within 60 times/15 minutes.

Examples

Request

66
POST WordFilterBaseUrl/v1/censorComment

{
"comment":"This is an inappropriate string."
}

Response
{

}
"result":false 21
95
09
00
Document serial number: 000009952166

00

©SCEI

- 12 -

Document serial number: 000009952166 0:0:0:0:0:9:9:5:2:1:6:6::c9bfab019f7e3ffc12bad043884264e6


Document serial number: 000009952166 0=0=0=0=0=9=9=5=2=1=6=6=:c9bfab019f7e3ffc12bad043884264e6

SCE CONFIDENTIAL

POST SanitizeComment
Correct inappropriate string

Request

URI
POST WordFilterBaseUrl/v1/sanitizeComment
• WordFilterBaseUrl
Specify the base URL for the Word Filter Web APIs group.

Query parameters
None

66
Header
Content-Type: application/json; charset=utf-8
Authorization: Bearer AccessToken
• AccessToken
Specify the access token.

Request body
{

}
"comment" : String
21
95
comment Target UTF-8 string to correct. Up to 1024 characters.

Response
09

Upon normal termination


Returns 200 for the HTTP status code, returns application/json for Content-Type for the header,
returns a boolean type result value indicating whether the specified string was appropriate or not
and a string-type sanitizedComment value with inappropriate language replaced with "*" for the
response body.
00

If the specified comment does not include any inappropriate language, the result value will be true,
and the same string as the one in comment will return for the sanitizedComment value.
Document serial number: 000009952166

Upon error
The HTTP status code and response body that indicate one of the errors common to all APIs (refer to the
"Error Codes" section) will be returned.
00

Description

This API is for correcting a string that contains inappropriate language input by a user. A UTF-8
encoded string is received, and if inappropriate language is included, a string with that part censored
will return.

It is not necessary to check the strings in chat, etc. Check strings that will be seen by all players and will
remain for long periods of time. Note that the rules for language considered to be inappropriate may
change without notice.

This API returns the assigned strings in their original language without any changes (except for
censored inappropriate language), no matter the language. It is not possible to restrict the language of
the returned strings, even if an Accept-Language header is specified.

©SCEI

- 13 -

Document serial number: 000009952166 0:0:0:0:0:9:9:5:2:1:6:6::c9bfab019f7e3ffc12bad043884264e6


Document serial number: 000009952166 0=0=0=0=0=9=9=5=2=1=6=6=:c9bfab019f7e3ffc12bad043884264e6

SCE CONFIDENTIAL

Use Restrictions

Platform Usable/Not Usable


PlayStation®4 application Not usable
PlayStation®3 application Not usable
PlayStation®Vita application Not usable
Companion application Usable
Application server/website Not usable

It is recommended that the frequency by which this API is called be kept within 30 times/15 minutes.

Examples

Request
POST WordFilterBaseUrl/v1/sanitizeComment

66
{
"comment":"This is an inappropriate string."
}

Response
{

}
"result":false,
21
"sanitizedComment":"This is an ********************."
95
09
00
Document serial number: 000009952166

00

©SCEI

- 14 -

Document serial number: 000009952166 0:0:0:0:0:9:9:5:2:1:6:6::c9bfab019f7e3ffc12bad043884264e6

You might also like