Skip to content

Connectivity

a7l edited this page Feb 23, 2017 · 25 revisions

####Description: Connectivity Service Returns state of network connectivity and authentication of the device

Method: GET

URL: http://pmapi/connectivity

Output: Standard HTTP status codes, and response data JSON array of connectivity flags.

Possible flags:

  • Offline
  • Internet
  • Online
  • Wifi
  • Cell
  • Authenticated
  • OfflineAuthenticated

####State Groups:

Generally, one flag from each of the groups will be present in the connectivity result returned:

Connection State:

  • Offline
  • Internet
  • Online

Connection Type:

  • Wifi
  • Cell

Authenticated State:

  • Authenticated
  • OfflineAuthenticated

Connection State Group Notes:

  • "Online" indicates that a connection to the current target server is available.
  • "Internet" indicates that the device reports it is connected to the internet, however a connection cannot be established with the current target server.
  • "Offline" indicates that the device reports no network connection is currently available.

Connection Type Group Notes:

  • If "Online" or "Internet" is present in the result list, then either "Wifi" or "Cell" will likely also be present in the result list, but may not, depending on the platform, if the connection type cannot be determined.

Authenticated State Group Notes:

  • "Authenticated" will be included in the result list, if "Online" is present in the result list, and the current user session is still active on the target server. (If the target server rejects the current user session as invalid, then "Authenticated" will not be included in the result list.)
  • "OfflineAuthenticated" will be included in the result list, if the user session was created via offline authentication.
  • "Authenticated" and "OfflineAuthenticated" states are independent. It is possible to have both "Authenticated" and "OfflineAuthenticated" states active at the same time.

Common State Key Combinations

The below list, includes most common combinations of the states returned by the connectivity API (the order of the keys in a given list, may vary from the order shown here):

  • Offline
    • Device is offline.
  • Offline, OfflineAuthenticated
    • Device is offline. User is authenticated offline.
  • Internet, Wifi|Cell
    • Device is online. Target server cannot be reached.
  • Internet, Wifi|Cell, OfflineAuthenticated
    • Device has internet access, but the target server cannot be reached. User is authenticated offline.
  • Online, Wifi|Cell
    • Device is online: it has internet access and the target server can be reached.
  • Online, Wifi|Cell, Authenticated
    • Device is online. Target server can be reached. User currently has a valid authenticated server session.
  • Online, Wifi|Cell, OfflineAuthenticated
    • Device is online. Target server can be reached. User is authenticated offline.

Notes:

The value "Wifi|Cell" is used in the above combination list, to indicate that either "Wifi" or "Cell" may occur in the result list, according to the detected connected network type.

When authenticated offline, even if a server connection becomes available, no data replication will occur with the target server until the user authenticates online, creating a session on the server.

Examples:

If a device is offline, and the device reports that no network connection is available, the response data will include: ["Offline"]

If a device cannot access it's configured server, but can access the internet in general, the response data will include "Internet" but not "Online", i.e.: ["Internet", "Wifi"]

If a device is online via Wifi, but the user is not authenticated, the response data will include: ["Online", "Wifi"]

If a device is online via Cell, with an online-authenticated user session, the response data will include: ["Online", "Cell", "Authenticated"]

Clone this wiki locally