China Game Data APIs Returning 403

Hello! I am testing an iOS app using the Blizzard API and I’d love to have support for all regions, but I’m having some trouble with the Chinese region.

I’m able to retrieve a Chinese OAuth access token using curl -u <id>:<secret> -d grant_type=client_credentials 'https://www.battlenet.com.cn/oauth/token':

HTTP/1.1 200 OK
Date: Wed, 26 Aug 2020 11:45:56 GMT
Server: Apache
X-Frame-Options: SAMEORIGIN
Retry-After: 600
Pragma: no-cache
Cache-Control: no-store
Vary: Accept-Encoding
Content-Encoding: gzip
Keep-Alive: timeout=10, max=4000
Transfer-Encoding: chunked
Content-Type: application/json;charset=UTF-8
Connection: keep-alive

{"access_token":"<token>","token_type":"bearer","expires_in":86399}

I am then able to retrieve data from the Wow Token endpoint using curl -H "Authorization: Bearer <token>" 'https://gateway.battlenet.com.cn/data/wow/token/?namespace=dynamic-cn'

HTTP/1.1 200 OK
Battlenet-Schema-Revision: 2
Date: Wed, 26 Aug 2020 11:45:59 GMT
Server: Apache-Coyote/1.1
Last-Modified: Wed, 26 Aug 2020 11:29:02 GMT
Battlenet-Namespace: dynamic-cn
vary: accept-encoding
Cache-Control: public, max-age=300
Battlenet-Schema: token
content-type: application/json;charset=UTF-8
content-encoding: gzip
Transfer-Encoding: chunked
x-trace-traceid: af46d01d-f6cf-32d6-92ff-160971237f7b
x-trace-spanid: 162b02c1-d3f0-57d0-24e2-fa169a45094f
x-trace-parentspanid: 162b02c1-d3f0-57a0-24e2-fa169a45094f
x-frame-options: SAMEORIGIN
X-Content-Type-Options: nosniff
Connection: keep-alive

{"_links":{"self":{"href":"https://gateway.battlenet.com.cn/data/wow/token/?namespace=dynamic-cn"}},"last_updated_timestamp":1598441342000,"price":2898460000}

Every other Game Data API endpoint that I attempt to use in the Chinese region fails with a response like so:

HTTP/1.1 403 Forbidden
content-length: 0
x-trace-traceid: 7a8cf016-d850-37bf-9119-b125dd9dc34b
x-trace-spanid: 162b02c0-0e3b-d870-c079-fa169ae27127
x-trace-parentspanid: 162b02c0-0e3b-d780-c079-fa169ae27127
x-frame-options: SAMEORIGIN
X-Content-Type-Options: nosniff
Connection: keep-alive

I’ve tried realmSearch, realmIndex, connectedRealmIndex, itemSearch. These endpoints return 200s for every region except China (us, eu, kr, tw). I’ve re-read the Regionality documentation a few times, but I don’t see anything that explains this behavior.

Is this expected for China or am I doing something wrong?

1 Like

As I remember, CN endpoints available only for mainland China residents. I do not know exactly how did they track it (probably, account registration), but I also receive 403 Error as many other users, which are not from CN region itself.

FWIW, I have access to a Chinese battle.net account which has API credentials set up at develop.battlenet.com.cn, and even still, I get 403 forbidden from most WoW APIs.

https://gateway.battlenet.com.cn/data/wow/achievement/6?namespace=static-cn&locale=zh_CN&access_token=CNxxxxxx
1 Like

Greetings,

Currently, the available APIs for the CN region are listed on the documentation references individually from their “global” counterparts. This list is currently limited to include only the WoW Token Index (CN) API.

We recognize this distinction is missing from guides and documentation pertaining to regionality, and as always, will look for opportunities to improve upon our documentation moving forward.

Thanks

2 Likes

Did you try with a non-china account but with a Chinese IP? There are VPN services you could use.

Just now I tried my previous example with a Chinese battle.net account with credentials set up at develop.battlenet.com.cn from a Chinese IP (China Telecom AS4812) and still got 403 forbidden.

Thanks for testing. Interesting. No idea on which grounds the access is denied then. Together with the blue post it seems that the Chinese API is disabled for everyone (apart from the wow token stuff).