Connecting SDK to API

To connect SDK to Oz API, specify the API URL and access token as shown below.

OZSDK.setApiConnection(Connection.fromServiceToken(host: "https://api.sandbox.ozforensics.com", token: token)) { (token, error) in
}

Please note: in your host application, it is recommended that you set the API address on the screen that precedes the liveness check. Setting the API URL initiates a service call to the API, which may cause excessive server load when being done at the application initialization or startup.

Alternatively, you can use the login and password provided by your Oz Forensics account manager:

OZSDK.setApiConnection(Connection.fromCredentials(host: “https://api.sandbox.ozforensics.com”, login: login, password: p)) { (token, error) in
    // Your code to handle error or token
}

For telemetry, set the separate connection as shown below:

let eventsConnection = Connection.fromCredentials(host: https://tm.ozforensics.com/,
                                login: <your_telemetry_user_eg_tm@company.com>,
                                password: your_telemetry_password)
OZSDK.setEventsConnection(eventsConnection) { (token, error) in
}

Last updated