HTTP
HTTP¶
-
Server Information Analytics Log Web Server URL is as follows.
-
Sandbox server : https://sandbox-analytics-log.withhive.com/v1/server-recv
- Common server : https://analytics-log.withhive.com/v1/server-recv
-
Header Information
-
Method: POST
- Content-Type : application/json; charset=utf8 (required)
- Content-Encoding : gzip (optional item to put a compressed binary in body)
# Example of using a compressed binary in body
{
"appId" : "com.com2us.hivesdk.freefull.google.global.android.common",
"logBody" : [
{
"category" : "test",
"dateTime" : "2017-07-24 16:46:36",
"timezone" : "GMT+09:00",
"guid" : "xxxx"
},
{
"category" : "test2",
"dateTime" : "2017-07-24 16:46:36",
"timezone" : "GMT+09:00",
"guid" : "xxxx2"
}
]
}
- Body Information
- JSON type. Send data as the format mentioned below. Some field requires designated key values.
- Essential parameter (Required to send the below fields from the logs)
appId | String | AppId designated on Hive SDK |
logBody | Array | Log Array |
logBody.catagory | String | Category designated in log definition |
logBody.dateTime | String | Log time with YYYY-MM-DD HH:mm:SS format in KST, or ISO-8601 |
logBody.guid | String | Random key value |
Put each value in the relevant row of logBody by following the log.
Example¶
Call¶
curl -d " { \"appId\" : \"com.com2us.hivesdk.freefull.google.global.android.common\", \"logBody\" : [ { \"category\" : \"hivesdk_levelup_log\", \"dateTime\" : \"2017-07-24 16:46:36\", \"timezone\" : \"GMT+09:00\", \"guid\" : \"xxxx\" } ] }" -X POST https://sandbox-analytics-log.withhive.com/v1/server-recv
Request¶
> POST /v1/server-recv HTTP/1.1
> Host: sandbox-analytics-log.withhive.com
> User-Agent: curl/7.55.1
> Accept: */*
> Content-Length: 208
> Content-Type: application/x-www-form-urlencoded
>
{
"appId" : "com.com2us.hivesdk.freefull.google.global.android.common",
"logBody" : [
{
"category" : "test",
"dateTime" : "2017-07-24 16:46:36",
"timezone" : "GMT+09:00",
"guid" : "xxxx"
}
]
}
Response¶
< HTTP/1.1 200 OK
< Server: nginx
< Date: Tue, 12 Nov 2019 09:36:55 GMT
< Content-Type: text/html; charset=UTF-8
< Transfer-Encoding: chunked
< Connection: close
< {"success":true}
- If HTTP response status code is 200, sending log is success. Unless, it is failed.
KEY | TYPE | VALUE | DESCRIPTION |
---|---|---|---|
success | boolean | false | False is fixed unless HTTP status code is 200 |
message | String | See below | Error message |
requestBody | String | Request value | The origin log transmitted |
- Error codes in the message field are as follows.
MESSAGE | DESCRIPTION |
---|---|
no json body | No parameter |
json parse error | JSON format error |
json format error = required field {col} not found | Essential column ({col}) does not exist |
[logBody] json format error = required field {logBody.col} not found | Essential column ({logBody.col}) does not exist in logBody |
unknown category key : | Category not supported is in use |