Network connection
Purpose¶
In short, this endpoint is to check the device Internet connection. So why do you need that? As a fact, the devices may go offline sometimes. As an automation tester, of course you don’t want to execute any tests on an offline device if your test case requires Internet connection. This is where this API comes in handy.
How to use this endpoint¶
Request¶
POST /v1/hub/device-health-check/network
Check a device Internet connection by letting that device ping to a domain.
Body parameters | Type | Required | Description |
---|---|---|---|
deviceInfo | object | true | Information of the device |
>>udid | string | false | |
>>platformName | string | false | |
>>platformVersion | string | false | |
domains | [string] | false | An array of domains |
timeout | integer | false | The duration allowed to ping a domain in seconds |
Response¶
Status | Meaning | Description |
---|---|---|
200 | OK | Send API success. Return success message and status |
400 | Bad request | Error syntax. Return message 'Unhandled path ...' |
401 | Unauthorized | The credential you entered was not authorized |
Sample¶
Request¶
curl --location --request POST 'https://api.kobiton.com/v1/hub/device-health-check/network' \
--header 'Content-Type: application/json' \
--header 'Authorization: {Your-authorization}' \
--data-raw '{
"deviceInfo": {
"platformName": "iOS",
"platformVersion": "14.3",
"udid": "{device-udid}"
},
"domains": [
"facebook.com"
],
"timeout": 60
}'
Response¶
{
"type": "NETWORK_HEALTH_CHECK",
"value": {
"status": "Reachable",
"ipAddress": "192.168.36.175",
"info": {
"timeout": 60,
"host": "https://facebook.com"
},
"usingProxy": false
}
}
Note¶
This endpoint is able to check the Internet connection through Wifi only, not the cellular network.
COMMENT