Make your first request
Let’s make a simple request for a resource using a URI (uniform resource identifier) and the Client key to check whether you can obtain the response correctly. For instance, if you want to know the version information of current TentuPlay SDK through REST API, here’s how to achieve the task.
Check SDK version
To retrieve the SDK version from TentuPlay server, compose the request using the following information.
Request
GET https://api.tentuplay.io/v2021.4/unity/configs HTTP/1.1
Content-Type:application/json
Response
Success
HTTP/1.1 200 OK
Content-Type:application/json
{
"status": 200,
"reason": "OK",
"data": {
"sdk_version": "2021.4"
}
}
Failure
Key |
Description |
Note |
|
---|---|---|---|
status |
reason |
||
403 |
"Method Not Allowed" |
The method is allowed for this operation (not GET, for example) |
|
400 |
"Missing Headers" |
No headers found |
|
400 |
"Missing TPAuthMode" |
No TPAuthMode key found |
|
400 |
"Invalid TPAuthMode" |
Unknown value in TPAuthMode key, not |
|
400 |
"Missing TPClientKey" |
No TPClientKey key found |
|
403 |
"Invalid TPClientKey" |
Invalid value in TPClientKey key |